Make code compliant with ONAP requirement
[vfc/nfvo/driver/vnfm/svnfm.git] / nokia / vnfmdriver / vfcadaptorservice / vfcadaptor / src / main / java / org / onap / vfc / nfvo / driver / vnfm / svnfm / msb / impl / MsbMgmrImpl.java
index 8f668c2..675229f 100644 (file)
@@ -86,17 +86,19 @@ public class MsbMgmrImpl implements IMsbMgmr {
        
    public String getServiceUrlInMsbBySeriveNameAndPort(String serviceName, String version) throws RouteException
    {
+          String serviceUrl = null;
           MSBServiceClient msbClient = new MSBServiceClient(adaptorEnv.getMsbIp(), adaptorEnv.getMsbPort());
           MicroServiceFullInfo microServiceInfo = msbClient.queryMicroServiceInfo(serviceName, version);
           if(null == microServiceInfo)
           {
                   logger.error("There is no service in MSB for serviceName = {} and version = {}", serviceName, version);
           }
-          
-          String serviceUrl = microServiceInfo.getUrl();
-               logger.info("Service Url in MSB for serviceName = {} and version = {} is {}", serviceName, version, serviceUrl);
-               
-               return serviceUrl;
+          else
+          {
+                  serviceUrl = microServiceInfo.getUrl();
+                  logger.info("Service Url in MSB for serviceName = {} and version = {} is {}", serviceName, version, serviceUrl);
+          }
+          return serviceUrl;
                
    }