Fixed crash retrieving the name of some displays.

This commit is contained in:
Camilla Berglund
2013-11-07 16:20:52 +01:00
parent 97ae40496d
commit cc7f0bd532
2 changed files with 5 additions and 2 deletions
+4 -2
View File
@@ -49,9 +49,11 @@ static const char* getDisplayName(CGDirectDisplayID displayID)
kIODisplayOnlyPreferredName);
names = CFDictionaryGetValue(info, CFSTR(kDisplayProductName));
if (!CFDictionaryGetValueIfPresent(names, CFSTR("en_US"),
(const void**) &value))
if (!names || !CFDictionaryGetValueIfPresent(names, CFSTR("en_US"),
(const void**) &value))
{
_glfwInputError(GLFW_PLATFORM_ERROR, "Failed to retrieve display name");
CFRelease(info);
return strdup("Unknown");
}