From b61b146209ff13e50c7c7dd5d636ab98f3b8b5d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Sat, 26 May 2012 16:57:37 +0200 Subject: [PATCH] Prevent null pointer passed to Client::belongToSameApplication Another fix for a regression introduced with 431aad6d6994695e72697fcc3299ec2cb6f0684e BUG: 300667 FIXED-IN: 4.9.0 REVIEW: 105062 --- layers.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/layers.cpp b/layers.cpp index 804e3ddca6..4521554fb9 100644 --- a/layers.cpp +++ b/layers.cpp @@ -326,12 +326,17 @@ void Workspace::lowerClientWithinApplication(Client* c) // first try to put it below the bottom-most window of the application for (ToplevelList::Iterator it = unconstrained_stacking_order.begin(); it != unconstrained_stacking_order.end(); - ++it) - if (Client::belongToSameApplication(qobject_cast(*it), c)) { + ++it) { + Client *client = qobject_cast(*it); + if (!client) { + continue; + } + if (Client::belongToSameApplication(client, c)) { unconstrained_stacking_order.insert(it, c); lowered = true; break; } + } if (!lowered) unconstrained_stacking_order.prepend(c); // ignore mainwindows