diff options
| -rw-r--r-- | sources/shiboken6/generator/shiboken/cppgenerator.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sources/shiboken6/generator/shiboken/cppgenerator.cpp b/sources/shiboken6/generator/shiboken/cppgenerator.cpp index 41b94da44..78ac69603 100644 --- a/sources/shiboken6/generator/shiboken/cppgenerator.cpp +++ b/sources/shiboken6/generator/shiboken/cppgenerator.cpp @@ -3314,7 +3314,7 @@ QString CppGenerator::argumentNameFromIndex(const AbstractMetaFunction *func, in if (!returnType.isVoid()) { pyArgName = QLatin1String(PYTHON_RETURN_VAR); *wrappedClass = AbstractMetaClass::findClass(classes(), returnType.typeEntry()); - if (errorMessage != nullptr) + if (*wrappedClass == nullptr && errorMessage != nullptr) *errorMessage = msgClassNotFound(returnType.typeEntry()); } else { if (errorMessage != nullptr) { @@ -3332,7 +3332,7 @@ QString CppGenerator::argumentNameFromIndex(const AbstractMetaFunction *func, in if (argType) { *wrappedClass = AbstractMetaClass::findClass(classes(), argType.typeEntry()); - if (errorMessage != nullptr) + if (*wrappedClass == nullptr && errorMessage != nullptr) *errorMessage = msgClassNotFound(argType.typeEntry()); if (argIndex == 1 && !func->isConstructor() |
