Work in progress for:
rdar://problem/10577182
Audit lldb API impl for places where we need to perform a NULL check
Add NULL checks for SBCommandInterpreter APIs.
git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@146909 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/API/SBCommandInterpreter.cpp b/source/API/SBCommandInterpreter.cpp
index fe514cb..03f33c6 100644
--- a/source/API/SBCommandInterpreter.cpp
+++ b/source/API/SBCommandInterpreter.cpp
@@ -65,7 +65,7 @@
bool
SBCommandInterpreter::CommandExists (const char *cmd)
{
- if (m_opaque_ptr)
+ if (cmd && m_opaque_ptr)
return m_opaque_ptr->CommandExists (cmd);
return false;
}
@@ -73,7 +73,7 @@
bool
SBCommandInterpreter::AliasExists (const char *cmd)
{
- if (m_opaque_ptr)
+ if (cmd && m_opaque_ptr)
return m_opaque_ptr->AliasExists (cmd);
return false;
}
@@ -88,7 +88,7 @@
m_opaque_ptr, command_line, result.get(), add_to_history);
result.Clear();
- if (m_opaque_ptr)
+ if (command_line && m_opaque_ptr)
{
TargetSP target_sp(m_opaque_ptr->GetDebugger().GetSelectedTarget());
Mutex::Locker api_locker;
@@ -98,7 +98,7 @@
}
else
{
- result->AppendError ("SBCommandInterpreter is not valid");
+ result->AppendError ("SBCommandInterpreter or the command line is not valid");
result->SetStatus (eReturnStatusFailed);
}