diff options
author | Thiago Macieira <thiago.macieira@intel.com> | 2013-04-18 14:41:50 -0700 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-04-19 07:53:21 +0200 |
commit | 96134c6f585963c9d449db17589f21e67519a2a8 (patch) | |
tree | a9983a12aefa894c925f721737b5911f6ce8e870 | |
parent | e34dccc9e563966caafb113bd8cacb70cf5d57fd (diff) |
Make sure to also check for null CFPropertyLists.
In 1b08e0307dfebe561fbb0819a2d6b53edd8e8e93, I removed the null check
by accident. It's possible for the Darwin API to return a null
property list.
Task-number: QTBUG-30760
Change-Id: Iaf0125767fe4b47c19810b70483a5219e94e4305
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
-rw-r--r-- | src/corelib/tools/qlocale_mac.mm | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/corelib/tools/qlocale_mac.mm b/src/corelib/tools/qlocale_mac.mm index 8594cfd40d..9292dccf19 100644 --- a/src/corelib/tools/qlocale_mac.mm +++ b/src/corelib/tools/qlocale_mac.mm @@ -438,6 +438,9 @@ QVariant QSystemLocale::query(QueryType type, QVariant in = QVariant()) const kCFPreferencesCurrentUser, kCFPreferencesAnyHost); QStringList result; + if (!languages) + return QVariant(result); + CFTypeID typeId = CFGetTypeID(languages); if (typeId == CFArrayGetTypeID()) { const int cnt = CFArrayGetCount(languages.as<CFArrayRef>()); |