The broker tries to look for a named appid before the registration actually occurs, which causes
a null exception. Adding a quick check for null/empty string to ensure this doesn't happen.