Check for null username when calling areCommandsAllowed. Fixes #1205