stratos-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From im...@apache.org
Subject stratos git commit: Fixing NPE in ComputeServiceBuilderUtil
Date Thu, 11 Dec 2014 19:44:56 GMT
Repository: stratos
Updated Branches:
  refs/heads/4.1.0-test fcc30c217 -> 4862a8b76


Fixing NPE in ComputeServiceBuilderUtil


Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/4862a8b7
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/4862a8b7
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/4862a8b7

Branch: refs/heads/4.1.0-test
Commit: 4862a8b760b0d86a441e9a5621cada697e1ef3ea
Parents: fcc30c2
Author: Imesh Gunaratne <imesh@apache.org>
Authored: Fri Dec 12 01:14:46 2014 +0530
Committer: Imesh Gunaratne <imesh@apache.org>
Committed: Fri Dec 12 01:14:46 2014 +0530

----------------------------------------------------------------------
 .../stratos/cloud/controller/util/ComputeServiceBuilderUtil.java | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/4862a8b7/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/util/ComputeServiceBuilderUtil.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/util/ComputeServiceBuilderUtil.java
b/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/util/ComputeServiceBuilderUtil.java
index 2cffcfb..af985b2 100644
--- a/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/util/ComputeServiceBuilderUtil.java
+++ b/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/util/ComputeServiceBuilderUtil.java
@@ -94,9 +94,9 @@ public class ComputeServiceBuilderUtil {
         if ((region = iaas.getProperty(CloudControllerConstants.REGION_PROPERTY)) == null)
{
             // if the property, isn't specified, try to obtain from the image id
             // image id can be in following format - {region}/{UUID}
-            region = iaas.getImage().contains("/") ? iaas.getImage().split("/")[0] : null;
+            region = (iaas.getImage() != null) && (iaas.getImage().contains("/"))
+                    ? iaas.getImage().split("/")[0] : null;
         }
-
         return region;
     }
     


Mime
View raw message