(Android) fix potential segfault