Few additional fixes to enable Client script access to Northbound.
[controller.git] / opendaylight / northbound / staticrouting / src / main / java / org / opendaylight / controller / forwarding / staticrouting / northbound / StaticRoutingNorthbound.java
index dceafac4abeb48facf3270a58322b1a5a1acc433..8462ef804ad0cce4c81819bd6b0369a675673566 100644 (file)
@@ -73,7 +73,7 @@ public class StaticRoutingNorthbound {
 
     @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;