diff options
author | 2018-08-02 11:35:54 +0900 | |
---|---|---|
committer | 2018-08-02 11:36:55 +0900 | |
commit | b306c6e8d29bac7566e71ef0a37152686828c3a4 (patch) | |
tree | d0d8cb61d53c7f28beb3fbb3652ca9f63118e54e /vid-app-common/src/main/java/org/onap/vid/services | |
parent | 67daf691099cbd800bba37266873eafb4c034a91 (diff) |
NPE and other code smells reported by sonar
Issue-ID: VID-278
Change-Id: Ib06ff30a0cc4e9d361a87b791513c8d38a09294a
Signed-off-by: Arindam Mondal <arind.mondal@samsung.com>
Diffstat (limited to 'vid-app-common/src/main/java/org/onap/vid/services')
-rw-r--r-- | vid-app-common/src/main/java/org/onap/vid/services/CsvServiceImpl.java | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/vid-app-common/src/main/java/org/onap/vid/services/CsvServiceImpl.java b/vid-app-common/src/main/java/org/onap/vid/services/CsvServiceImpl.java index 6f5f4f73..c34bf4e6 100644 --- a/vid-app-common/src/main/java/org/onap/vid/services/CsvServiceImpl.java +++ b/vid-app-common/src/main/java/org/onap/vid/services/CsvServiceImpl.java @@ -177,7 +177,10 @@ public class CsvServiceImpl implements CsvService{ currentJson.put(new JSONObject().put(key, values)); } else { JSONObject lastItem = lastItemInArray(currentJson); - lastItem.put(key, values); + if(lastItem != null){ + lastItem.put(key, values); + } + } } } |