Fixed possible NullPointerException

Happened on MCPC+, likely to happen on vanilla servers too.