Catch NullPointerException in ProfileManager