Fix ndk NULL dereference