diff --git a/src/corelib/text/qlocale_unix.cpp b/src/corelib/text/qlocale_unix.cpp index 3f563db107e..2315c65587f 100644 --- a/src/corelib/text/qlocale_unix.cpp +++ b/src/corelib/text/qlocale_unix.cpp @@ -127,6 +127,8 @@ QLocale QSystemLocale::fallbackLocale() const QVariant QSystemLocale::query(QueryType type, QVariant &&in) const { QSystemLocaleData *d = qSystemLocaleData(); + if (!d) + return QVariant(); if (type == LocaleChanged) { d->readEnvironment(); diff --git a/src/corelib/text/qlocale_win.cpp b/src/corelib/text/qlocale_win.cpp index 165bec4f77d..af1a53101e1 100644 --- a/src/corelib/text/qlocale_win.cpp +++ b/src/corelib/text/qlocale_win.cpp @@ -870,6 +870,8 @@ QLocale QSystemLocale::fallbackLocale() const QVariant QSystemLocale::query(QueryType type, QVariant &&in) const { QSystemLocalePrivate *d = systemLocalePrivate(); + if (!d) + return QVariant(); switch(type) { case DecimalPoint: return d->decimalPoint();