Skip to content

Instantly share code, notes, and snippets.

@alanmcgovern
Created March 6, 2013 11:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alanmcgovern/ec7aeb4efcfb6d679394 to your computer and use it in GitHub Desktop.
Save alanmcgovern/ec7aeb4efcfb6d679394 to your computer and use it in GitHub Desktop.
diff --git a/gdk/quartz/gdkwindow-quartz.c b/gdk/quartz/gdkwindow-quartz.c
index 7302090..837b1a9 100644
--- a/gdk/quartz/gdkwindow-quartz.c
+++ b/gdk/quartz/gdkwindow-quartz.c
@@ -2722,9 +2722,11 @@ gdk_window_set_decorations (GdkWindow *window,
* NSTitledWindowMask. This behaved extremely oddly when
* conditionalized upon that and since it has no side effects (i.e.
* if NSTitledWindowMask is not requested, the title will not be
- * displayed) just do it unconditionally.
+ * displayed) just do it unconditionally. We also must null check
+ * 'title' before setting it to avoid crashing.
*/
- [impl->toplevel setTitle:title];
+ if (title)
+ [impl->toplevel setTitle:title];
}
else
{
@@ -2744,7 +2746,8 @@ gdk_window_set_decorations (GdkWindow *window,
screen:screen];
[impl->toplevel setHasShadow: window_type_hint_to_shadow (impl->type_hint)];
[impl->toplevel setLevel: window_type_hint_to_level (impl->type_hint)];
- [impl->toplevel setTitle:title];
+ if (title)
+ [impl->toplevel setTitle:title];
[impl->toplevel setBackgroundColor:bg];
[impl->toplevel setHidesOnDeactivate: window_type_hint_to_hides_on_deactivate (impl->type_hint)];
[impl->toplevel setContentView:old_view];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment