Fixed bug 3048, "Crashes in Cocoa_SetWindowTitle"
authorDavid Ludwig <dludwig@pobox.com>
Sat, 04 Jul 2015 21:04:49 -0400
changeset 9796 e0db4fedf80c
parent 9795 63c4d6f1f85f
child 9797 c142db5785ad
Fixed bug 3048, "Crashes in Cocoa_SetWindowTitle"
src/video/cocoa/SDL_cocoawindow.m
--- a/src/video/cocoa/SDL_cocoawindow.m	Sat Jul 04 14:09:09 2015 -0400
+++ b/src/video/cocoa/SDL_cocoawindow.m	Sat Jul 04 21:04:49 2015 -0400
@@ -1428,7 +1428,7 @@
 { @autoreleasepool
 {
     if (SetWindowStyle(window, GetWindowStyle(window))) {
-        if (bordered) {
+        if (bordered && window->title) {
             Cocoa_SetWindowTitle(_this, window);  /* this got blanked out. */
         }
     }
@@ -1499,7 +1499,7 @@
     s_moveHack = SDL_GetTicks();
 
     /* When the window style changes the title is cleared */
-    if (!fullscreen) {
+    if (!fullscreen && window->title) {
         Cocoa_SetWindowTitle(_this, window);
     }