fix crash in dialog_response when the dialog was created without a parent (GTK) default tip

Sat, 01 Aug 2026 13:20:05 +0200

author
Olaf Wintermann <olaf.wintermann@gmail.com>
date
Sat, 01 Aug 2026 13:20:05 +0200
changeset 1224
6fa0876583bb
parent 1223
83b2c5391fc5

fix crash in dialog_response when the dialog was created without a parent (GTK)

ui/gtk/window.c file | annotate | diff | comparison | revisions
--- a/ui/gtk/window.c	Mon Jul 27 21:18:38 2026 +0200
+++ b/ui/gtk/window.c	Sat Aug 01 13:20:05 2026 +0200
@@ -511,8 +511,8 @@
 static void dialog_response(AdwAlertDialog *self, gchar *response, UiEventData *data) {
     UiEvent evt;
     evt.obj = data->obj;
-    evt.document = evt.obj->ctx->document;
-    evt.window = evt.obj->window;
+    evt.document = evt.obj ? evt.obj->ctx->document : NULL;
+    evt.window = evt.obj ? evt.obj->window : NULL;
     evt.eventdata = NULL;
     evt.eventdatatype = 0;
     evt.intval = 0;

mercurial