Fixed a potential crash

Crash dump:

http://crash.pocketmine.net/view/19038