Fixed a NullPointerException

Just to be safe. It fixes the crash described below:
http://crashes.to/s/b625413ca16