summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--runtime/jdwp/jdwp_event.cc8
1 files changed, 8 insertions, 0 deletions
diff --git a/runtime/jdwp/jdwp_event.cc b/runtime/jdwp/jdwp_event.cc
index 1bf16b285c..cb28ff0647 100644
--- a/runtime/jdwp/jdwp_event.cc
+++ b/runtime/jdwp/jdwp_event.cc
@@ -1015,6 +1015,14 @@ void JdwpState::PostThreadChange(Thread* thread, bool start) {
return;
}
+ // We need the java.lang.Thread object associated to the starting/ending
+ // thread to get its JDWP id. Therefore we can't report event if there
+ // is no Java peer. This happens when the runtime shuts down and re-attaches
+ // the current thread without creating a Java peer.
+ if (thread->GetPeer() == nullptr) {
+ return;
+ }
+
ModBasket basket;
basket.thread = thread;