Repository: stratos
Updated Branches:
  refs/heads/docker-grouping-merge 44fd12546 -> a61fc9d0b


Fixing NPE while deploying applications without properties


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

Branch: refs/heads/docker-grouping-merge
Commit: a61fc9d0b484826f87426132a1a2a5bc18ad60f3
Parents: 44fd125
Author: Lahiru Sandaruwan <[email protected]>
Authored: Sat Nov 1 22:50:34 2014 +0530
Committer: Lahiru Sandaruwan <[email protected]>
Committed: Sat Nov 1 22:50:34 2014 +0530

----------------------------------------------------------------------
 .../stratos/rest/endpoint/services/ServiceUtils.java  | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/a61fc9d0/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/services/ServiceUtils.java
----------------------------------------------------------------------
diff --git 
a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/services/ServiceUtils.java
 
b/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/services/ServiceUtils.java
index b3e8747..97eda89 100644
--- 
a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/services/ServiceUtils.java
+++ 
b/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/services/ServiceUtils.java
@@ -136,13 +136,15 @@ public class ServiceUtils {
         applicationContext.setTeantAdminUsername(userName);
 
         Properties properties = new Properties();
-        
for(org.apache.stratos.manager.composite.application.beans.PropertyBean 
propertyBean : appDefinition.getProperty()) {
-            Property property = new Property();
-            property.setName(propertyBean.getName());
-            property.setValue(propertyBean.getValue());
-            properties.addProperties(property);
+        if(appDefinition.getProperty() != null) {
+            for 
(org.apache.stratos.manager.composite.application.beans.PropertyBean 
propertyBean : appDefinition.getProperty()) {
+                Property property = new Property();
+                property.setName(propertyBean.getName());
+                property.setValue(propertyBean.getValue());
+                properties.addProperties(property);
+            }
+            applicationContext.setProperties(properties);
         }
-        applicationContext.setProperties(properties);
 
         try {
             
CloudControllerServiceClient.getServiceClient().deployApplicationDefinition(applicationContext);

Reply via email to