Skip to content

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

fix: Cannot read property 'topics' of undefined

thecodrrdbcf983d94cc
diff --git a/apps/web/src/navigation/routes.js b/apps/web/src/navigation/routes.js
index be735addf..9102ed9b6 100644
--- a/apps/web/src/navigation/routes.js
+++ b/apps/web/src/navigation/routes.js
@@ -32,7 +32,7 @@ const routes = {
},
"/notebooks/:notebook/:topic": ({ notebook, topic }) => {
const nb = db.notebooks.notebook(notebook);
- const topicItem = nb.topics.topic(topic)._topic;
+ const topicItem = nb?.topics?.topic(topic)?._topic;
if (!topicItem) return navigate(`/notebooks/${nb.id}`);
return (