diff options
author | lizi <li.zi30@zte.com.cn> | 2017-09-28 09:59:31 +0800 |
---|---|---|
committer | lizi <li.zi30@zte.com.cn> | 2017-09-28 09:59:31 +0800 |
commit | 0efbd308a9fdc886d662d43119379d9d47eaca0e (patch) | |
tree | 048382211b5f17cad01c4cbd7ed29efe49dece81 | |
parent | d9c27be95d4a3f61a5c2e77722162bd939e30858 (diff) |
Fix the bug about query VIM.
Fix the bug "If a cloud-region didn't contain a external system info, there will be an null pointer error".
Change-Id: I2cdd45bfc9836ce8369feb4d5af6bc6bcee84201
Issue-ID: AAI-398
Signed-off-by: lizi <li.zi30@zte.com.cn>
-rw-r--r-- | esr-mgr/src/main/java/org/onap/aai/esr/util/VimManagerUtil.java | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/esr-mgr/src/main/java/org/onap/aai/esr/util/VimManagerUtil.java b/esr-mgr/src/main/java/org/onap/aai/esr/util/VimManagerUtil.java index 1fc68a9..2a390d9 100644 --- a/esr-mgr/src/main/java/org/onap/aai/esr/util/VimManagerUtil.java +++ b/esr-mgr/src/main/java/org/onap/aai/esr/util/VimManagerUtil.java @@ -80,7 +80,10 @@ public class VimManagerUtil { VimRegisterInfo vimRegisterInfo = new VimRegisterInfo(); VimAuthInfo vimAuthInfo = new VimAuthInfo(); ArrayList<VimAuthInfo> vimAuthInfos = new ArrayList<VimAuthInfo>(); - vimAuthInfo = authInfo2VimAuthInfo(cloudRegion.getEsrSystemInfoList().getEsrSystemInfo().get(0)); + if(cloudRegion.getEsrSystemInfoList()!=null){ + vimAuthInfo = authInfo2VimAuthInfo(cloudRegion.getEsrSystemInfoList().getEsrSystemInfo().get(0)); + vimRegisterInfo.setStatus(cloudRegion.getEsrSystemInfoList().getEsrSystemInfo().get(0).getSystemStatus()); + } vimAuthInfos.add(vimAuthInfo); vimRegisterInfo.setVimAuthInfos(vimAuthInfos); vimRegisterInfo.setCloudExtraInfo(cloudRegion.getCloudExtraInfo()); @@ -91,7 +94,6 @@ public class VimManagerUtil { vimRegisterInfo.setComplexName(cloudRegion.getComplexName()); vimRegisterInfo.setCloudRegionVersion(cloudRegion.getCloudRegionVersion()); vimRegisterInfo.setOwnerDefinedType(cloudRegion.getOwnerDefinedType()); - vimRegisterInfo.setStatus(cloudRegion.getEsrSystemInfoList().getEsrSystemInfo().get(0).getSystemStatus()); return vimRegisterInfo; } } |