<rdar://problem/10776614>
Fixed an issue where we can crash if you call cast when the SBValue
doesn't contain a valid value.
git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@149345 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/API/SBValue.cpp b/source/API/SBValue.cpp
index b72c8f1..96182e3 100644
--- a/source/API/SBValue.cpp
+++ b/source/API/SBValue.cpp
@@ -377,7 +377,10 @@
lldb::SBValue
SBValue::Cast (SBType type)
{
- return CreateChildAtOffset(m_opaque_sp->GetName().GetCString(), 0, type);
+ lldb::SBValue sb_value;
+ if (m_opaque_sp)
+ sb_value = CreateChildAtOffset(m_opaque_sp->GetName().GetCString(), 0, type);
+ return sb_value;
}
lldb::SBValue