From e7c9326c63077634c5aa68940f5c24677177c9d6 Mon Sep 17 00:00:00 2001 From: sebdet Date: Thu, 23 Apr 2020 15:17:59 +0200 Subject: Fix bugs reported by sonar Fix bugs reported by sonar as critical, major, ... Issue-ID: CLAMP-841 Signed-off-by: sebdet Change-Id: Id525d532d4f405216da44f95503e06e172458e70 --- .../dialogs/ManageDictionaries/ManageDictionaries.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'ui-react') diff --git a/ui-react/src/components/dialogs/ManageDictionaries/ManageDictionaries.js b/ui-react/src/components/dialogs/ManageDictionaries/ManageDictionaries.js index 2af1b7ce..71477ae0 100644 --- a/ui-react/src/components/dialogs/ManageDictionaries/ManageDictionaries.js +++ b/ui-react/src/components/dialogs/ManageDictionaries/ManageDictionaries.js @@ -88,11 +88,13 @@ function SubDict(props) { const {onChange} = props; const subDicts = []; subDicts.push('Default'); - for(var item in dictList) { - if(dictList[item].secondLevelDictionary === 1) { - subDicts.push(dictList[item].name); - } - }; + if (dictList != "undefined" && dictList.length > 0) { + for(var item in dictList) { + if(dictList[item].secondLevelDictionary === 1) { + subDicts.push(dictList[item].name); + } + }; + } subDicts.push(''); var optionItems = subDicts.map( (item) => -- cgit 1.2.3-korg