Fixed potential NPE's for usernames

Added some null checks for getting username of the active user.
Merge pull request #159 from fredrikpersson/nullauth

Fixed potential NPE's for usernames