diff --git a/apps/common/main/lib/util/utils.js b/apps/common/main/lib/util/utils.js index 948cbb4e3..d5ee83ea3 100644 --- a/apps/common/main/lib/util/utils.js +++ b/apps/common/main/lib/util/utils.js @@ -762,6 +762,8 @@ Common.Utils.loadConfig = function(url, callback) { else return 'error'; }).then(function(json){ callback(json); + }).catch(function(e) { + callback('error'); }); }; diff --git a/apps/spreadsheeteditor/main/app/view/FormulaDialog.js b/apps/spreadsheeteditor/main/app/view/FormulaDialog.js index 7e1a94cff..d5991d3be 100644 --- a/apps/spreadsheeteditor/main/app/view/FormulaDialog.js +++ b/apps/spreadsheeteditor/main/app/view/FormulaDialog.js @@ -159,7 +159,7 @@ define([ hide: function () { var val = this.cmbFuncGroup.getValue(); (val=='Recommended') && (val = 'Last10'); - if (this.cmbFuncGroup.store.at(0).get('value')=='Recommended') { + if (this.cmbFuncGroup.store.length>0 && this.cmbFuncGroup.store.at(0).get('value')=='Recommended') { this.cmbFuncGroup.store.shift(); this.cmbFuncGroup.onResetItems(); } @@ -337,7 +337,7 @@ define([ var removed = arr.splice(idx, 1); arr.unshift(removed[0]); } - } else if (arr.length==0 && this.cmbFuncGroup.store.at(0).get('value')=='Recommended') { + } else if (arr.length==0 && this.cmbFuncGroup.store.length>0 && this.cmbFuncGroup.store.at(0).get('value')=='Recommended') { this.cmbFuncGroup.store.shift(); this.cmbFuncGroup.onResetItems(); }