From b81123865d60c8fb10dc109a3d5cc41416e1f8b0 Mon Sep 17 00:00:00 2001 From: Aleix Pol Gonzalez Date: Mon, 19 Sep 2022 13:49:14 +0000 Subject: [PATCH] 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 45486ce515b498d0e30631d4cc63fbb28c5060f7 This is a blind non-reproduced fix for the issue here: https://errors-eval.kde.org/organizations/kde/issues/158/ --- src/tabbox/tabboxhandler.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/tabbox/tabboxhandler.cpp b/src/tabbox/tabboxhandler.cpp index 1e6536e3a6..592f5dc7ec 100644 --- a/src/tabbox/tabboxhandler.cpp +++ b/src/tabbox/tabboxhandler.cpp @@ -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 {