diff --git a/src/corelib/global/qlibraryinfo.cpp b/src/corelib/global/qlibraryinfo.cpp
index 24afe719c130fc14769c2fe135d44e958c589847..484c7869a693a0a0b815c8d66d00ff7e73ee1c1f 100644
--- a/src/corelib/global/qlibraryinfo.cpp
+++ b/src/corelib/global/qlibraryinfo.cpp
@@ -162,7 +162,7 @@ QSettings *QLibraryInfoPrivate::findConfiguration()
     if(!QFile::exists(qtconfig))
         qtconfig = qmake_libraryInfoFile();
 #else
-    if (!QFile::exists(qtconfig) && QCoreApplication::instance()) {
+    if (!QFile::exists(qtconfig)) {
 #ifdef Q_OS_MAC
         CFBundleRef bundleRef = CFBundleGetMainBundle();
         if (bundleRef) {
@@ -177,10 +177,12 @@ QSettings *QLibraryInfoPrivate::findConfiguration()
         }
         if (qtconfig.isEmpty())
 #endif
-            {
+        {
+            if (QCoreApplication::instance()) {
                 QDir pwd(QCoreApplication::applicationDirPath());
                 qtconfig = pwd.filePath(QLatin1String("qt.conf"));
             }
+        }
     }
 #endif
     if (QFile::exists(qtconfig))