From 992f2230bf2a4ea4266fe7518d91551374a11fac Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Mon, 7 Nov 2022 19:23:03 +0100 Subject: [PATCH] Fix remember opened categories (#4827) #fix https://github.com/FreshRSS/FreshRSS/issues/4826 Was crashing if a category did not exist anymore --- p/scripts/main.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/p/scripts/main.js b/p/scripts/main.js index 30fc795a1..268fd2858 100644 --- a/p/scripts/main.js +++ b/p/scripts/main.js @@ -777,8 +777,10 @@ function rememberOpenCategory(category_id, isOpen) { function openCategory(category_id) { const category_element = document.getElementById(category_id); + if (!category_element) return; category_element.querySelector('.tree-folder-items').classList.add('active'); const img = category_element.querySelector('a.dropdown-toggle img'); + if (!img) return; img.src = img.src.replace('/icons/down.', '/icons/up.'); img.alt = '🔼'; }