From bba066c44ce2e106cc73c1d978036872db66f75e Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Tue, 7 Jan 2025 20:35:06 +0000 Subject: [PATCH] tray: Don't call g_object_unref(NULL) g_object_unref() only accepts valid object instances. Signed-off-by: Simon McVittie --- src/tray/unix/SDL_tray.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/tray/unix/SDL_tray.c b/src/tray/unix/SDL_tray.c index de2ab4b2c7..c2635665eb 100644 --- a/src/tray/unix/SDL_tray.c +++ b/src/tray/unix/SDL_tray.c @@ -671,7 +671,9 @@ void SDL_DestroyTray(SDL_Tray *tray) SDL_RemovePath(tray->icon_path); } - g_object_unref(tray->indicator); + if (tray->indicator) { + g_object_unref(tray->indicator); + } SDL_free(tray);