summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2013-04-18 21:41:50 (GMT)
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-08-05 20:02:58 (GMT)
commit47029709b61d17f2b764f5eb72a210fc7deb28ee (patch)
treed7f6535060b26360f43c0725cbc5d5536055b707 /src/corelib/tools
parentaee13de2457b2c4f35aed0cd01935dc951d08698 (diff)
downloadQt-47029709b61d17f2b764f5eb72a210fc7deb28ee.zip
Qt-47029709b61d17f2b764f5eb72a210fc7deb28ee.tar.gz
Qt-47029709b61d17f2b764f5eb72a210fc7deb28ee.tar.bz2
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 (cherry-picked from qtbase commit 96134c6f585963c9d449db17589f21e67519a2a8) Reviewed-by: Denis Dzyubenko <denis@ddenis.info> Reviewed-by: Jake Petroules <jake.petroules@petroules.com> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
Diffstat (limited to 'src/corelib/tools')
-rw-r--r--src/corelib/tools/qlocale_mac.mm3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/corelib/tools/qlocale_mac.mm b/src/corelib/tools/qlocale_mac.mm
index b2a3094..6007d31 100644
--- a/src/corelib/tools/qlocale_mac.mm
+++ b/src/corelib/tools/qlocale_mac.mm
@@ -442,6 +442,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>());