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