diff options
author | 2018-03-02 04:12:25 -0500 | |
---|---|---|
committer | 2018-03-02 04:12:45 -0500 | |
commit | 64b7cc2b82655bd38788f83f36d1266cace70381 (patch) | |
tree | 77874012b2338232dfefc651955db420914b7972 /esr-mgr/src | |
parent | 59a95d6dfa955aa13dade154233431550e48d1ac (diff) |
Fix the bug about nullpointer when update VIM
Change-Id: I25d81a88a7fec20a6f1ebca26b727cee64be1d96
Issue-ID: AAI-832
Signed-off-by: LiZi <li.zi30@zte.com.cn>
Diffstat (limited to 'esr-mgr/src')
-rw-r--r-- | esr-mgr/src/main/java/org/onap/aai/esr/wrapper/VimManagerWrapper.java | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/esr-mgr/src/main/java/org/onap/aai/esr/wrapper/VimManagerWrapper.java b/esr-mgr/src/main/java/org/onap/aai/esr/wrapper/VimManagerWrapper.java index 82c6f77..fe44536 100644 --- a/esr-mgr/src/main/java/org/onap/aai/esr/wrapper/VimManagerWrapper.java +++ b/esr-mgr/src/main/java/org/onap/aai/esr/wrapper/VimManagerWrapper.java @@ -207,16 +207,20 @@ public class VimManagerWrapper { private CloudRegionDetail getVimUpdateInfo(VimRegisterInfo vimRegisterInfo) { String cloudOwner = vimRegisterInfo.getCloudOwner(); String cloudRegionId = vimRegisterInfo.getCloudRegionId(); + String resourceVersion = null; + CloudRegionDetail cloudRegionDetail = new CloudRegionDetail(); CloudRegionDetail originalCloudRegionDetail = getOriginalCloudRegion(cloudOwner, cloudRegionId); - String resourceVersion = originalCloudRegionDetail.getResourceVersion(); - CloudRegionDetail cloudRegionDetail = vimManagerUtil.vimRegisterInfo2CloudRegion(vimRegisterInfo); - if (resourceVersion != null) { - cloudRegionDetail.setResourceVersion(resourceVersion); - EsrSystemInfo originalSystemInfo = originalCloudRegionDetail.getEsrSystemInfoList().getEsrSystemInfo().get(0); - cloudRegionDetail.getEsrSystemInfoList().getEsrSystemInfo().get(0) - .setEsrSystemInfoId(originalSystemInfo.getEsrSystemInfoId()); - cloudRegionDetail.getEsrSystemInfoList().getEsrSystemInfo().get(0) - .setResouceVersion(originalSystemInfo.getResouceVersion()); + if (originalCloudRegionDetail != null) { + resourceVersion = originalCloudRegionDetail.getResourceVersion(); + cloudRegionDetail = vimManagerUtil.vimRegisterInfo2CloudRegion(vimRegisterInfo); + if (resourceVersion != null) { + cloudRegionDetail.setResourceVersion(resourceVersion); + EsrSystemInfo originalSystemInfo = originalCloudRegionDetail.getEsrSystemInfoList().getEsrSystemInfo().get(0); + cloudRegionDetail.getEsrSystemInfoList().getEsrSystemInfo().get(0) + .setEsrSystemInfoId(originalSystemInfo.getEsrSystemInfoId()); + cloudRegionDetail.getEsrSystemInfoList().getEsrSystemInfo().get(0) + .setResouceVersion(originalSystemInfo.getResouceVersion()); + } } return cloudRegionDetail; } |