From 56834dc3852b5085c7d7af898530be78cf7dd1a6 Mon Sep 17 00:00:00 2001
From: Marko Lindqvist <cazfi74@gmail.com>
Date: Sat, 7 Nov 2026 15:13:09 +0200
Subject: [PATCH 33/33] gtk: Correct senseless gui_dialog check

Check that pointer storage is not NULL,
instead of the pointer itself, before trying
to assign NULL to the pointer.
The pointer storage should never be NULL,
so this check is expected to be redundant anyway.

See RM #2446

Signed-off-by: Marko Lindqvist <cazfi74@gmail.com>
---
 client/gui-gtk-3.22/gui_stuff.c | 2 +-
 client/gui-gtk-4.0/gui_stuff.c  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/client/gui-gtk-3.22/gui_stuff.c b/client/gui-gtk-3.22/gui_stuff.c
index 788e95cf95..cc68a92f0f 100644
--- a/client/gui-gtk-3.22/gui_stuff.c
+++ b/client/gui-gtk-3.22/gui_stuff.c
@@ -339,7 +339,7 @@ static void gui_dialog_destroy_handler(GtkWidget *w, struct gui_dialog *dlg)
 
   g_object_unref(dlg->gui_button);
 
-  if (*(dlg->source)) {
+  if (dlg->source != NULL) {
     *(dlg->source) = NULL;
   }
 
diff --git a/client/gui-gtk-4.0/gui_stuff.c b/client/gui-gtk-4.0/gui_stuff.c
index 67416abaae..5dd68c8b76 100644
--- a/client/gui-gtk-4.0/gui_stuff.c
+++ b/client/gui-gtk-4.0/gui_stuff.c
@@ -895,7 +895,7 @@ void gui_dialog_destroy(struct gui_dialog *dlg)
     break;
   }
 
-  if (*(dlg->source)) {
+  if (dlg->source != NULL) {
     *(dlg->source) = NULL;
   }
 }
-- 
2.53.0

