You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stratos.apache.org by im...@apache.org on 2014/12/11 20:44:56 UTC

stratos git commit: Fixing NPE in ComputeServiceBuilderUtil

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 <im...@apache.org>
Authored: Fri Dec 12 01:14:46 2014 +0530
Committer: Imesh Gunaratne <im...@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;
     }