Check that the data buffer is non-null before getting its file contents.
llvm-svn: 162400
This commit is contained in:
parent
7d63968d30
commit
1e4f425d2f
|
@ -2422,7 +2422,11 @@ TargetProperties::GetExpressionPrefixContentsAsCString ()
|
|||
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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue