aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp')
-rw-r--r--lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp b/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
index 3c0aa29..1a23074 100644
--- a/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
+++ b/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
@@ -1949,8 +1949,11 @@ ScriptInterpreterPythonImpl::CreateScriptCommandObject(const char *class_name) {
PythonObject ret_val = LLDBSwigPythonCreateCommandObject(
class_name, m_dictionary_name.c_str(), debugger_sp);
- return StructuredData::GenericSP(
- new StructuredPythonObject(std::move(ret_val)));
+ if (ret_val.IsValid())
+ return StructuredData::GenericSP(
+ new StructuredPythonObject(std::move(ret_val)));
+ else
+ return {};
}
bool ScriptInterpreterPythonImpl::GenerateTypeScriptFunction(