Fix bugs reported by sonar 03/106503/1
authorsebdet <sebastien.determe@intl.att.com>
Thu, 23 Apr 2020 13:17:59 +0000 (15:17 +0200)
committersebdet <sebastien.determe@intl.att.com>
Thu, 23 Apr 2020 13:17:59 +0000 (15:17 +0200)
Fix bugs reported by sonar as critical, major, ...

Issue-ID: CLAMP-841
Signed-off-by: sebdet <sebastien.determe@intl.att.com>
Change-Id: Id525d532d4f405216da44f95503e06e172458e70

ui-react/src/components/dialogs/ManageDictionaries/ManageDictionaries.js

index 2af1b7c..71477ae 100644 (file)
@@ -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) => <option key={item}>{item}</option>