From 9093f3c39b8fa8ef836c627e1db329cd7349e9bb Mon Sep 17 00:00:00 2001 From: Jim Ingham Date: Tue, 14 Feb 2023 13:09:16 -0800 Subject: Report a useful error when someone passes an incorrect python class name. --- .../Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp') 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( -- cgit v1.1