From 6eef19dfc6d2d859cc31e8ca2f0e722c212786a8 Mon Sep 17 00:00:00 2001 From: Bernd Bestel Date: Sun, 15 Nov 2020 15:20:50 +0100 Subject: [PATCH] Fixed DataTables state load when there are no settings saved --- public/js/grocy.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/public/js/grocy.js b/public/js/grocy.js index 83bcb50a..a6ef8b44 100644 --- a/public/js/grocy.js +++ b/public/js/grocy.js @@ -723,7 +723,14 @@ $.extend(true, $.fn.dataTable.defaults, { { var settingKey = 'datatables_state_' + settings.sTableId; - return JSON.parse(Grocy.UserSettings[settingKey]); + if (Grocy.UserSettings[settingKey] == undefined) + { + return null; + } + else + { + return JSON.parse(Grocy.UserSettings[settingKey]); + } } });