Add missing null check in Container name validation 11/1211/1
authorAlessandro Boch <aboch@cisco.com>
Tue, 17 Sep 2013 00:59:38 +0000 (17:59 -0700)
committerAlessandro Boch <aboch@cisco.com>
Tue, 17 Sep 2013 01:00:38 +0000 (18:00 -0700)
Change-Id: Ie13d7a3a5d1068064e1c8d72ec9a8b6b343077c6
Signed-off-by: Alessandro Boch <aboch@cisco.com>
opendaylight/containermanager/api/src/main/java/org/opendaylight/controller/containermanager/ContainerConfig.java

index 01715cc..a347469 100644 (file)
@@ -223,7 +223,7 @@ public class ContainerConfig implements Serializable {
      */
     private Status validateName() {
         // No Container configuration allowed to container default
-        return (container.matches(regexName) && !container.equalsIgnoreCase(GlobalConstants.DEFAULT.toString())) ?
+        return ((container != null) && container.matches(regexName) && !container.equalsIgnoreCase(GlobalConstants.DEFAULT.toString())) ?
                 new Status(StatusCode.SUCCESS) : new Status(StatusCode.BADREQUEST, "Invalid container name");
     }