Fixed DataTables state load when there are no settings saved

This commit is contained in:
Bernd Bestel 2020-11-15 15:20:50 +01:00
parent 9942a2dbab
commit 6eef19dfc6
No known key found for this signature in database
GPG Key ID: 71BD34C0D4891300

View File

@ -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]);
}
}
});