Commit d0ba0c1d8af4387672e5426b586ddd187be9bc7f

David Ludwig 2015-07-04T21:04:49

Fixed bug 3048, "Crashes in Cocoa_SetWindowTitle"

diff --git a/src/video/cocoa/SDL_cocoawindow.m b/src/video/cocoa/SDL_cocoawindow.m
index 8914fe8..4259273 100644
--- a/src/video/cocoa/SDL_cocoawindow.m
+++ b/src/video/cocoa/SDL_cocoawindow.m
@@ -1428,7 +1428,7 @@ Cocoa_SetWindowBordered(_THIS, SDL_Window * window, SDL_bool bordered)
 { @autoreleasepool
 {
     if (SetWindowStyle(window, GetWindowStyle(window))) {
-        if (bordered) {
+        if (bordered && window->title) {
             Cocoa_SetWindowTitle(_this, window);  /* this got blanked out. */
         }
     }
@@ -1499,7 +1499,7 @@ Cocoa_SetWindowFullscreen(_THIS, SDL_Window * window, SDL_VideoDisplay * display
     s_moveHack = SDL_GetTicks();
 
     /* When the window style changes the title is cleared */
-    if (!fullscreen) {
+    if (!fullscreen && window->title) {
         Cocoa_SetWindowTitle(_this, window);
     }