diff options
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmDebuggerAdapter.cxx | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/Source/cmDebuggerAdapter.cxx b/Source/cmDebuggerAdapter.cxx index d03f79d..c2e0d4f 100644 --- a/Source/cmDebuggerAdapter.cxx +++ b/Source/cmDebuggerAdapter.cxx @@ -167,10 +167,16 @@ cmDebuggerAdapter::cmDebuggerAdapter( (void)req; std::unique_lock<std::mutex> lock(Mutex); dap::ThreadsResponse response; - dap::Thread thread; - thread.id = DefaultThread->GetId(); - thread.name = DefaultThread->GetName(); - response.threads.push_back(thread); + + // If a client requests threads during shutdown (like after receiving the + // thread exited event), DefaultThread won't be set. + if (DefaultThread) { + dap::Thread thread; + thread.id = DefaultThread->GetId(); + thread.name = DefaultThread->GetName(); + response.threads.push_back(thread); + } + return response; }); |