diff --git a/lldb/source/Plugins/Language/ObjC/Cocoa.cpp b/lldb/source/Plugins/Language/ObjC/Cocoa.cpp --- a/lldb/source/Plugins/Language/ObjC/Cocoa.cpp +++ b/lldb/source/Plugins/Language/ObjC/Cocoa.cpp @@ -72,6 +72,9 @@ valobj.GetCompilerType().GetBasicTypeFromAST(lldb::eBasicTypeObjCID), true)); + if (!text) + return false; + StreamString summary_stream; bool was_nsstring_ok = NSStringSummaryProvider(*text, summary_stream, options); @@ -117,6 +120,10 @@ uint64_t offset = ptr_size; ValueObjectSP text(valobj.GetSyntheticChildAtOffset( offset, valobj.GetCompilerType(), true)); + + if (!text) + return false; + StreamString summary_stream; bool was_nsstring_ok = NSStringSummaryProvider(*text, summary_stream, options); @@ -162,6 +169,10 @@ uint64_t offset = ptr_size; ValueObjectSP text(valobj.GetSyntheticChildAtOffset( offset, valobj.GetCompilerType(), true)); + + if (!text) + return false; + StreamString summary_stream; bool was_nsstring_ok = NSStringSummaryProvider(*text, summary_stream, options);