From 6b40609b42bd93bbc2491b1c097aa52f38763028 Mon Sep 17 00:00:00 2001 From: Daniel Jettka Date: Fri, 11 Oct 2024 10:58:49 +0200 Subject: [PATCH] Fix/279 start documents uri not found (#439) * added exception to not throw error on empty key * changed find in array method * condition to only load links on start when provided * changed to use of parameter lax --- app/Application.js | 6 ++++-- app/controller/PreferenceController.js | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/app/Application.js b/app/Application.js index 718f97b75..518fa186f 100644 --- a/app/Application.js +++ b/app/Application.js @@ -186,7 +186,9 @@ Ext.define('EdiromOnline.Application', { openStartDocuments: function () { var me = this; - var uris = me.getController('PreferenceController').getPreference('start_documents_uri'); - window.loadLink(uris); + var uris = me.getController('PreferenceController').getPreference('start_documents_uri', true); + if(uris){ + window.loadLink(uris); + } } }); diff --git a/app/controller/PreferenceController.js b/app/controller/PreferenceController.js index 5669b75e7..63512f334 100644 --- a/app/controller/PreferenceController.js +++ b/app/controller/PreferenceController.js @@ -64,6 +64,7 @@ Ext.define('EdiromOnline.controller.PreferenceController', { getPreference: function(key, lax) { var me = this; + // if key does not exist but lax is true, return null if(!me.preferences[key] && lax) return null; @@ -86,7 +87,7 @@ Ext.define('EdiromOnline.controller.PreferenceController', { key: key, level: 'warn' //warn, error, fatal }); - + return null; }