================ @@ -1089,9 +1089,9 @@ void SBDebugger::SetSelectedTarget(SBTarget &sb_target) { Log *log = GetLog(LLDBLog::API); TargetSP target_sp(sb_target.GetSP()); - if (m_opaque_sp) { + if (m_opaque_sp && target_sp) m_opaque_sp->GetTargetList().SetSelectedTarget(target_sp); ---------------- jimingham wrote:
Actually, is there any circumstance in which we'd want to set the selected target to an empty or invalid target? I don't think so, in which case we should probably do that checking in TargetList::SetSelectedTarget. https://github.com/llvm/llvm-project/pull/80508 _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits