From 9094da0805978a779afe9102a63dbacf55eb7de1 Mon Sep 17 00:00:00 2001 From: thecodrr Date: Tue, 21 Apr 2020 12:01:15 +0500 Subject: [PATCH] hotfix: crash when moving an item to trash This should probably be investigated more and fixed properly. Seems like a core issue to me. --- apps/web/src/components/note/index.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/apps/web/src/components/note/index.js b/apps/web/src/components/note/index.js index de209523f..853eba560 100644 --- a/apps/web/src/components/note/index.js +++ b/apps/web/src/components/note/index.js @@ -162,6 +162,8 @@ function Note(props) { export default React.memo(Note, function (prevProps, nextProps) { const prevItem = prevProps.item; const nextItem = nextProps.item; + // TODO need to investigate why a crash happens here. + if (!prevItem || !nextItem) return true; return ( prevItem.pinned === nextItem.pinned && prevItem.favorite === nextItem.favorite &&