From facd18330474b174b3c3413adb48c3a010abd7cb Mon Sep 17 00:00:00 2001 From: Zankaria Date: Wed, 12 Feb 2025 23:09:22 +0100 Subject: [PATCH] fav.js: handle undefined favorites --- js/options/fav.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/options/fav.js b/js/options/fav.js index 331007d2..3236e70e 100644 --- a/js/options/fav.js +++ b/js/options/fav.js @@ -23,7 +23,7 @@ function addBoard(){ add_favorites(); } //This adds the text inside the textbox to favorites, localStorage.favorites and the page -var favorites = JSON.parse(localStorage.favorites); +var favorites = localStorage.favorites ? JSON.parse(localStorage.favorites) : []; Options.add_tab('fav-tab','star',_("Favorites")); //Pregenerating list of boards