Browse Source

AMBARI-16948. Not able to save custom config in view config. (Gaurav Nagar via pallavkul)

Pallav Kulshreshtha 9 years ago
parent
commit
8a1e89da57

+ 5 - 2
ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ViewInstanceResourceProvider.java

@@ -351,8 +351,11 @@ public class ViewInstanceResourceProvider extends AbstractAuthorizedResourceProv
       viewInstanceEntity.setIcon64((String) properties.get(ICON64_PATH_ID));
       viewInstanceEntity.setIcon64((String) properties.get(ICON64_PATH_ID));
     }
     }
 
 
-    if (properties.containsKey(CLUSTER_HANDLE_PROPERTY_ID)) {
-      viewInstanceEntity.setClusterHandle(Long.valueOf((String) properties.get(CLUSTER_HANDLE_PROPERTY_ID)));
+    String handle = (String) properties.get(CLUSTER_HANDLE_PROPERTY_ID);
+    if (handle != null) {
+      viewInstanceEntity.setClusterHandle(Long.valueOf(handle));
+    } else {
+      viewInstanceEntity.setClusterHandle(null);
     }
     }
 
 
     if (properties.containsKey(CLUSTER_TYPE_PROPERTY_ID)) {
     if (properties.containsKey(CLUSTER_TYPE_PROPERTY_ID)) {