Merge "toaster-it: add missing version for maven-paxexam-plugin"
[controller.git] / opendaylight / northbound / hosttracker / src / main / java / org / opendaylight / controller / hosttracker / northbound / HostTrackerNorthbound.java
index 2530d78416bf691dc2ea34bded2c8014fc574905..769461167c1036812ea33f17d0ffcf8f2b21a6c5 100644 (file)
@@ -78,7 +78,7 @@ public class HostTrackerNorthbound {
 
     @Context
     public void setSecurityContext(SecurityContext context) {
-        username = context.getUserPrincipal().getName();
+        if (context != null && context.getUserPrincipal() != null) username = context.getUserPrincipal().getName();
     }
 
     protected String getUserName() {