Make sure to also check for null CFPropertyLists.

In 1b08e0307d, 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>
This commit is contained in:
Thiago Macieira 2013-04-18 14:41:50 -07:00 committed by The Qt Project
parent e34dccc9e5
commit 96134c6f58

View File

@ -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>());