aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Plugins/ScriptInterpreter/Python
diff options
context:
space:
mode:
authorJim Ingham <jingham@apple.com>2023-02-14 13:09:16 -0800
committerJim Ingham <jingham@apple.com>2023-02-14 13:47:14 -0800
commit9093f3c39b8fa8ef836c627e1db329cd7349e9bb (patch)
tree036427ca689ebcec06fb7db22857c925e6ff1acb /lldb/source/Plugins/ScriptInterpreter/Python
parent853a46cfb1ca3b75ab0bd65b2c02d1a0d60c84c3 (diff)
downloadllvm-9093f3c39b8fa8ef836c627e1db329cd7349e9bb.zip
llvm-9093f3c39b8fa8ef836c627e1db329cd7349e9bb.tar.gz
llvm-9093f3c39b8fa8ef836c627e1db329cd7349e9bb.tar.bz2
Report a useful error when someone passes an incorrect python class name.
Diffstat (limited to 'lldb/source/Plugins/ScriptInterpreter/Python')
-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(