aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXue Gao <xg353y@intl.att.com>2020-04-27 08:57:40 +0000
committerGerrit Code Review <gerrit@onap.org>2020-04-27 08:57:40 +0000
commit615eb9bc91c2e685c4eebb96b44b157fd71fa8f0 (patch)
tree02c1845e93a58c47609c54b70bc4400062f45270
parent740a4cb495e6069d3d5cb3b93ca35594f64a3419 (diff)
parente7c9326c63077634c5aa68940f5c24677177c9d6 (diff)
Merge changes Id525d532,I91723b83
* changes: Fix bugs reported by sonar Fix bugs reported by sonar
-rw-r--r--src/main/java/org/onap/clamp/policy/operational/OperationalPolicyRepresentationBuilder.java2
-rw-r--r--ui-react/src/components/dialogs/ManageDictionaries/ManageDictionaries.js12
2 files changed, 8 insertions, 6 deletions
diff --git a/src/main/java/org/onap/clamp/policy/operational/OperationalPolicyRepresentationBuilder.java b/src/main/java/org/onap/clamp/policy/operational/OperationalPolicyRepresentationBuilder.java
index 8bd8aac7..5f6cb31b 100644
--- a/src/main/java/org/onap/clamp/policy/operational/OperationalPolicyRepresentationBuilder.java
+++ b/src/main/java/org/onap/clamp/policy/operational/OperationalPolicyRepresentationBuilder.java
@@ -319,7 +319,7 @@ public class OperationalPolicyRepresentationBuilder {
if (TYPE_LIST.equalsIgnoreCase(type)) {
property.addProperty(TYPE, "array");
- if (cdsProperty.get(PROPERTIES) != null) {
+ if (cdsProperty != null && cdsProperty.get(PROPERTIES) != null) {
JsonObject dataObject = new JsonObject();
addDataFields(cdsProperty.get(PROPERTIES).getAsJsonObject(),
dataObject);
diff --git a/ui-react/src/components/dialogs/ManageDictionaries/ManageDictionaries.js b/ui-react/src/components/dialogs/ManageDictionaries/ManageDictionaries.js
index 538688da..54ac6411 100644
--- a/ui-react/src/components/dialogs/ManageDictionaries/ManageDictionaries.js
+++ b/ui-react/src/components/dialogs/ManageDictionaries/ManageDictionaries.js
@@ -87,11 +87,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>