Few additional fixes to enable Client script access to Northbound.
[controller.git] / opendaylight / northbound / flowprogrammer / src / main / java / org / opendaylight / controller / flowprogrammer / northbound / FlowProgrammerNorthbound.java
index e863f99514adef7f8e339fd027c0f83d318b799f..2d270b44f98e23d65c0f03bddab1f913aabda7d5 100644 (file)
@@ -70,7 +70,7 @@ public class FlowProgrammerNorthbound {
 
     @Context
     public void setSecurityContext(SecurityContext context) {
-        username = context.getUserPrincipal().getName();
+        if (context != null && context.getUserPrincipal() != null) username = context.getUserPrincipal().getName();
     }
 
     protected String getUserName() {