Skip to content

Commit

Permalink
Fix/279 start documents uri not found (#439)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
daniel-jettka authored Oct 11, 2024
1 parent 49e4764 commit cf4862a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
6 changes: 4 additions & 2 deletions app/Application.js
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,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);
}
}
});
3 changes: 2 additions & 1 deletion app/controller/PreferenceController.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -86,7 +87,7 @@ Ext.define('EdiromOnline.controller.PreferenceController', {
key: key,
level: 'warn' //warn, error, fatal
});

return null;
}

Expand Down

0 comments on commit cf4862a

Please sign in to comment.