Skip to content

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

mobile: add some null checks

ammarahm-edaf906d8acea2
diff --git a/apps/mobile/app/components/sheets/topic-sheet/index.tsx b/apps/mobile/app/components/sheets/topic-sheet/index.tsx
index 658948839..cfafacac2 100644
--- a/apps/mobile/app/components/sheets/topic-sheet/index.tsx
+++ b/apps/mobile/app/components/sheets/topic-sheet/index.tsx
@@ -154,7 +154,7 @@ export const TopicsSheet = () => {
}
if (id) {
onRequestUpdate({
- item: db.notebooks?.notebook(id).data
+ item: db.notebooks?.notebook(id)?.data
} as any);
}
ref.current?.show();
diff --git a/apps/mobile/app/services/notifications.ts b/apps/mobile/app/services/notifications.ts
index c0ecbaf6d..834576658 100644
--- a/apps/mobile/app/services/notifications.ts
+++ b/apps/mobile/app/services/notifications.ts
@@ -367,7 +367,8 @@ async function scheduleNotification(
function loadNote(id: string, jump: boolean) {
if (!id || id === "notesnook_note_input") return;
- const note = db.notes?.note(id).data;
+ const note = db.notes?.note(id)?.data;
+ if (!note) return;
if (!DDS.isTab && jump) {
tabBarRef.current?.goToPage(1);
}