Prevent null pointer passed to Client::belongToSameApplication

Another fix for a regression introduced with
431aad6d6994695e72697fcc3299ec2cb6f0684e

BUG: 300667
FIXED-IN: 4.9.0
REVIEW: 105062
icc-effect-5.14.5
Martin Gräßlin 2012-05-26 16:57:37 +02:00
parent 57ce41d966
commit b61b146209
1 changed files with 7 additions and 2 deletions

View File

@ -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<Client*>(*it), c)) {
++it) {
Client *client = qobject_cast<Client*>(*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