From 7ec2558eefd61028b73b0ee4af2e1bd96904fb98 Mon Sep 17 00:00:00 2001 From: "G.Ambatte" Date: Sat, 14 Sep 2024 23:43:26 +1200 Subject: [PATCH] Add guard clause for history UI items --- client/homebrew/editor/snippetbar/snippetbar.jsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/client/homebrew/editor/snippetbar/snippetbar.jsx b/client/homebrew/editor/snippetbar/snippetbar.jsx index f282cd8b6..4e5908c5a 100644 --- a/client/homebrew/editor/snippetbar/snippetbar.jsx +++ b/client/homebrew/editor/snippetbar/snippetbar.jsx @@ -153,6 +153,8 @@ const Snippetbar = createClass({ return
{_.map(historyItems, (item, index)=>{ + if(!item.savedAt) return; + const saveTime = new Date(item.savedAt); const diffTime = new Date() - saveTime; const diffMins = Math.floor(diffTime / (60 * 1000));