Check that the data buffer is non-null before getting its file contents.
git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@162400 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/Target/Target.cpp b/source/Target/Target.cpp
index 5a49aab..289944f 100644
--- a/source/Target/Target.cpp
+++ b/source/Target/Target.cpp
@@ -2422,7 +2422,11 @@
const uint32_t idx = ePropertyExprPrefix;
OptionValueFileSpec *file = m_collection_sp->GetPropertyAtIndexAsOptionValueFileSpec (NULL, false, idx);
if (file)
- return (const char *)file->GetFileContents()->GetBytes();
+ {
+ DataBufferSP data_sp(file->GetFileContents());
+ if (data_sp)
+ return (const char *) data_sp->GetBytes();
+ }
return NULL;
}