mirror of
https://github.com/glfw/glfw.git
synced 2026-09-18 22:55:46 +00:00
Fixed crash retrieving the name of some displays.
This commit is contained in:
+4
-2
@@ -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");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user