diff options
-rw-r--r-- | tools/qmlscene/main.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/tools/qmlscene/main.cpp b/tools/qmlscene/main.cpp index ff31f63ed5..312b180df5 100644 --- a/tools/qmlscene/main.cpp +++ b/tools/qmlscene/main.cpp @@ -271,6 +271,10 @@ static bool checkVersion(const QUrl &url) QTextStream stream(&f); bool codeFound= false; while (!codeFound) { + if (stream.atEnd()) { + fprintf(stderr, "qmlscene: no code found in file '%s'.\n", qPrintable(fileName)); + return false; + } QString line = stream.readLine(); if (line.contains(QLatin1Char('{'))) { codeFound = true; @@ -690,6 +694,8 @@ int main(int argc, char ** argv) // QQuickView if one was created. That case is tracked by // QPointer, so it is safe to delete the component here. delete component; + } else { + exitCode = 1; } } |