Few additional fixes to enable Client script access to Northbound.
[controller.git] / opendaylight / northbound / networkconfiguration / bridgedomain / src / main / java / org / opendaylight / controller / networkconfig / bridgedomain / northbound / BridgeDomainNorthbound.java
index 8aa1cf22fc780fe5a8937f580bfd50533e75ee7a..da7faa2c78d9cf9b4155ce244cbd190ea649b4a8 100644 (file)
@@ -56,7 +56,7 @@ public class BridgeDomainNorthbound {
 
     @Context
     public void setSecurityContext(SecurityContext context) {
-        username = context.getUserPrincipal().getName();
+        if (context != null && context.getUserPrincipal() != null) username = context.getUserPrincipal().getName();
     }
     protected String getUserName() {
         return username;