tabbox: Makes sure we are not calling a null pointer

The desktopClient is a weak pointer and therefore can be null. This
makes sure that we are not calling a null instance of it.

It seems likely it was introduced here 45486ce515

This is a blind non-reproduced fix for the issue here:
https://errors-eval.kde.org/organizations/kde/issues/158/
This commit is contained in:
Aleix Pol Gonzalez 2022-09-19 13:49:14 +00:00 committed by Vlad Zahorodnii
parent ab79fe47ce
commit b81123865d

View file

@ -170,7 +170,8 @@ void TabBoxHandlerPrivate::updateHighlightWindows()
}
lastRaisedClient = currentClient;
// don't elevate desktop
if (currentClient && currentClient->internalId() != q->desktopClient().toStrongRef()->internalId()) {
const auto desktop = q->desktopClient().toStrongRef();
if (currentClient && (!desktop || currentClient->internalId() != desktop->internalId())) {
q->elevateClient(currentClient, w, true);
}
} else {