Fixes crash on permission check

### [View the report #18248 on the Crash Archive](http://crash.pocketmine.net/view/18248)