aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2020-11-12 17:16:49 +0100
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2020-11-12 16:46:27 +0000
commit07e18f0d1a4bbfb66860fa8d410160583cfbe36b (patch)
treeaefb7249987ed9052f15892b4214af5364c34b8a
parentc499316c3c746602ecaa1a74c6387842d8261998 (diff)
shiboken6: Format error message only when class was not found
Amends 696c2831613aefdaca83520e4b7dbd9a57d91d3f. Change-Id: I770fa144e0775127ec55a63fe197c295b17c683e Reviewed-by: Christian Tismer <tismer@stackless.com>
-rw-r--r--sources/shiboken6/generator/shiboken/cppgenerator.cpp4
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()