diff options
-rw-r--r-- | tests/auto/sanity/tst_sanity.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/tests/auto/sanity/tst_sanity.cpp b/tests/auto/sanity/tst_sanity.cpp index 25e118e3..2c67e86a 100644 --- a/tests/auto/sanity/tst_sanity.cpp +++ b/tests/auto/sanity/tst_sanity.cpp @@ -280,9 +280,12 @@ static void addTestRows(QQmlEngine *engine, const QString &sourcePath, const QSt if (QFile::exists(filePath)) { QTest::newRow(qPrintable(name)) << QUrl::fromLocalFile(filePath); break; - } else if (QFile::exists(QQmlFile::urlToLocalFileOrQrc(filePath))) { - QTest::newRow(qPrintable(name)) << QUrl(filePath); - break; + } else { + filePath = QQmlFile::urlToLocalFileOrQrc(filePath); + if (!filePath.isEmpty() && QFile::exists(filePath)) { + QTest::newRow(qPrintable(name)) << QUrl(filePath); + break; + } } } } |