From d74fa138b90eb915ca0a174befb2b47d15a585d9 Mon Sep 17 00:00:00 2001 From: thecodrr Date: Tue, 15 Jun 2021 12:00:00 +0500 Subject: [PATCH] fix: check if cached monographs are null --- packages/core/api/monographs.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/core/api/monographs.js b/packages/core/api/monographs.js index 0387d6cb8..8ef03b9b0 100644 --- a/packages/core/api/monographs.js +++ b/packages/core/api/monographs.js @@ -35,6 +35,7 @@ class Monographs { * @returns {boolean} Whether note is published or not. */ async isPublished(noteId) { + if (!this.monographs) return false; return !!this.monographs[noteId]; } @@ -44,6 +45,7 @@ class Monographs { * @returns Monograph Id */ async monograph(noteId) { + if (!this.monographs) return; return this.monographs[noteId]; }