BUGFIX: Fixed a potential null pointer crash.