From 96134c6f585963c9d449db17589f21e67519a2a8 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Thu, 18 Apr 2013 14:41:50 -0700 Subject: Make sure to also check for null CFPropertyLists. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- src/corelib/tools/qlocale_mac.mm | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/corelib/tools/qlocale_mac.mm') 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()); -- cgit v1.2.3