diff --git a/README.md b/README.md index 848bc303..729f74da 100644 --- a/README.md +++ b/README.md @@ -55,6 +55,7 @@ guide in the GLFW documentation. - [Cocoa] Bugfix: Full screen windows were never reported as having focus - [Cocoa] Bugfix: A superfluous I/O flag test prevented video modes from being listed for Thunderbolt monitor + - [Cocoa] Bugfix: Retrieving the name of some external displays caused segfault - [X11] Added setting of the `WM_CLASS` property to the initial window title - [X11] Bugfix: Removed joystick axis value negation left over from GLFW 2 - [X11] Bugfix: The position of hidden windows was ignored by Metacity diff --git a/src/cocoa_monitor.m b/src/cocoa_monitor.m index 504a5fc9..caddde40 100644 --- a/src/cocoa_monitor.m +++ b/src/cocoa_monitor.m @@ -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"); }