mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-11-27 15:14:31 +00:00
Add null pointer checks to some SBStream functions.
llvm-svn: 226016
This commit is contained in:
1 parent
859ea8056d
commit
e2dcbd001c
1 file changed
+6
@@ -70,6 +70,9 @@ SBStream::Printf (const char *format, ...)
|
||||
void
|
||||
SBStream::RedirectToFile (const char *path, bool append)
|
||||
{
|
||||
if (path == nullptr)
|
||||
return;
|
||||
|
||||
std::string local_data;
|
||||
if (m_opaque_ap.get())
|
||||
{
|
||||
@@ -104,6 +107,9 @@ SBStream::RedirectToFile (const char *path, bool append)
|
||||
void
|
||||
SBStream::RedirectToFileHandle (FILE *fh, bool transfer_fh_ownership)
|
||||
{
|
||||
if (fh == nullptr)
|
||||
return;
|
||||
|
||||
std::string local_data;
|
||||
if (m_opaque_ap.get())
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user