diff --git a/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/config/SettingsManager.js b/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/config/SettingsManager.js index 71b066cefd9084e273f7759564d614734cd547b0..0e43deb1e9061a3db82b09849b7745586e12313b 100644 --- a/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/config/SettingsManager.js +++ b/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/config/SettingsManager.js @@ -24,8 +24,12 @@ function SettingsManager(serverFacade) { if(!data[0]) { window.alert("The item is no longer available, refresh the page, if the problem persists tell your admin that the Lucene index is probably corrupted."); } else { - var settings = JSON.parse(data[0].properties.ELN_SETTINGS); - callback(settings); + if (data[0].properties && data[0].properties.ELN_SETTINGS) { + var settings = JSON.parse(data[0].properties.ELN_SETTINGS); + callback(settings); + } else { + callback(); + } } }).bind(this)) } @@ -34,12 +38,14 @@ function SettingsManager(serverFacade) { // Applies the settings to the profile even if they are invalid. this.loadSettingsAndApplyToProfile = function(doneCallback) { this.loadSettings((function(settings) { - var errors = this._validateSettings(settings); - if (errors.length > 0) { - console.log("The settings contain the following errors:"); - console.log(errors); + if (settings) { + var errors = this._validateSettings(settings); + if (errors.length > 0) { + console.log("The settings contain the following errors:"); + console.log(errors); + } + this.applySettingsToProfile(settings, profile); } - this.applySettingsToProfile(settings, profile); doneCallback(); }).bind(this)); } diff --git a/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/SettingsForm/SettingsFormController.js b/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/SettingsForm/SettingsFormController.js index 54559081453e7370eff05aca066418665eb713b7..45ed12f9048e4092aae731658fb921c5923325a9 100644 --- a/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/SettingsForm/SettingsFormController.js +++ b/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/SettingsForm/SettingsFormController.js @@ -24,7 +24,9 @@ function SettingsFormController(mainController, settingsSample, mode) { // apply settings to copy of profile, even if invalid, for editing var profileToEdit = jQuery.extend(true, {}, profile); this._settingsManager.loadSettings((function(settings) { - this._settingsManager.applySettingsToProfile(settings, profileToEdit); + if (settings) { + this._settingsManager.applySettingsToProfile(settings, profileToEdit); + } this._settingsFormView.repaint(views, profileToEdit); }).bind(this)); }