In ThreadList::GetSelectedThread, handle the case where we have no

valid threads - can happen if attaching to a process fails in a
certain way.

llvm-svn: 139567
This commit is contained in:
Jason Molenda 2011-09-13 01:13:16 +00:00
parent 542adbfccf
commit 354b9a65f9
1 changed files with 2 additions and 0 deletions

View File

@ -548,6 +548,8 @@ ThreadList::GetSelectedThread ()
ThreadSP thread_sp = FindThreadByID(m_selected_tid);
if (!thread_sp.get())
{
if (m_threads.size() == 0)
return thread_sp;
m_selected_tid = m_threads[0]->GetID();
thread_sp = m_threads[0];
}