Add null check for onEntityEnterPortal

Haven't tested this yet, the build script doesn't work for me (on Linux), but this should at least stop the crashes.