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