Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

mobile: fix crash when opening notebook (happens randomly)

Ammar Ahmed38690d18d4a3
diff --git a/apps/mobile/app/screens/notebook/index.tsx b/apps/mobile/app/screens/notebook/index.tsx
index 86aea806b..14d67c796 100644
--- a/apps/mobile/app/screens/notebook/index.tsx
+++ b/apps/mobile/app/screens/notebook/index.tsx
@@ -193,11 +193,13 @@ const NotebookScreen = ({ route, navigation }: NavigationProps<"Notebook">) => {
headerTitle={notebook?.title}
loading={loading}
CustomLisHeader={
- <NotebookHeader
- breadcrumbs={breadcrumbs}
- notebook={notebook!}
- totalNotes={notes?.placeholders.length || 0}
- />
+ notebook ? (
+ <NotebookHeader
+ breadcrumbs={breadcrumbs}
+ notebook={notebook}
+ totalNotes={notes?.placeholders.length || 0}
+ />
+ ) : undefined
}
placeholder={{
title: notebook?.title!,