From 5b476901d2e5855268f79a77f103ac42110ee9f8 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Fri, 11 Sep 2020 10:47:09 +0300 Subject: [PATCH] [SSE] Fix Bug 46535 --- apps/common/main/lib/util/utils.js | 2 ++ apps/spreadsheeteditor/main/app/view/FormulaDialog.js | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) 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(); }