From 0bd40968ab802c19734985e0a8748d239712f9ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michel=20D=C3=A4nzer?= Date: Wed, 1 Nov 2023 17:51:38 +0100 Subject: [PATCH] wayland/transaction: Handle NULL from->state in entry_merge_into This never happened so far, but it will with following commits. Part-of: --- src/wayland/meta-wayland-transaction.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/wayland/meta-wayland-transaction.c b/src/wayland/meta-wayland-transaction.c index 9b999bfa9..6158ae35c 100644 --- a/src/wayland/meta-wayland-transaction.c +++ b/src/wayland/meta-wayland-transaction.c @@ -496,14 +496,18 @@ meta_wayland_transaction_entry_merge_into (MetaWaylandTransactionEntry *from, to->has_sub_pos = TRUE; } - if (to->state) + if (from->state) { - meta_wayland_surface_state_merge_into (from->state, to->state); - g_clear_object (&from->state); - return; + if (to->state) + { + meta_wayland_surface_state_merge_into (from->state, to->state); + g_clear_object (&from->state); + } + else + { + to->state = g_steal_pointer (&from->state); + } } - - to->state = g_steal_pointer (&from->state); } void