Fix the GetCurrentMethod bug.

Change-Id: I1f28dd991ed209afe42d785887bc15344baa4526
diff --git a/src/thread.cc b/src/thread.cc
index 10b099d..64f618c 100644
--- a/src/thread.cc
+++ b/src/thread.cc
@@ -1594,8 +1594,8 @@
 #else
 Method* Thread::GetCurrentMethod(uintptr_t*, Method***) const {
   ShadowFrame* frame = top_shadow_frame_;
-  while (frame->GetMethod()->IsNative()) {
-    frame = frame->GetLink();
+  if (frame == NULL) {
+    return NULL;
   }
   return frame->GetMethod();
 }