Move checking pointer code block before accessing the pointer This caused lldb to crash when testing on Android