You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
kf5-kdeclarative/0002-Don-t-call-null-object...

44 lines
1.2 KiB

From 24d27b9cb733f727431c64e0a7845c39152c1104 Mon Sep 17 00:00:00 2001
From: Aleix Pol <aleixpol@kde.org>
Date: Tue, 16 Feb 2016 02:11:35 +0100
Subject: [PATCH 2/2] Don't call null object pointer
BUG: 347962
REVIEW: 127060
---
src/kdeclarative/qmlobject.cpp | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/src/kdeclarative/qmlobject.cpp b/src/kdeclarative/qmlobject.cpp
index f3cee66..db09a0a 100644
--- a/src/kdeclarative/qmlobject.cpp
+++ b/src/kdeclarative/qmlobject.cpp
@@ -113,9 +113,7 @@ void QmlObjectPrivate::errorPrint(QQmlComponent *component)
void QmlObjectPrivate::execute(const QUrl &source)
{
if (source.isEmpty()) {
-#ifndef NDEBUG
- qDebug() << "File name empty!";
-#endif
+ qWarning() << "File name empty!";
return;
}
@@ -309,6 +307,13 @@ void QmlObject::completeInitialization(const QVariantHash &initialProperties)
if (d->incubator.object()) {
return;
}
+
+ if (!d->component) {
+ qWarning() << "No component for" << source();
+ return;
+ }
+
+
if (d->component->status() != QQmlComponent::Ready || d->component->isError()) {
d->errorPrint(d->component);
return;
--
2.5.0