From 012c64b054a5017a64d24f806fcc9c61e0ee3e5d Mon Sep 17 00:00:00 2001 From: Vlad Zahorodnii Date: Wed, 20 Mar 2024 14:49:20 +0200 Subject: [PATCH] Fix warning about nullptr sender in QObject::connect() When one sets "no border" property, the decoration can be null. --- src/xdgshellwindow.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/xdgshellwindow.cpp b/src/xdgshellwindow.cpp index 9e08aba4a5..6b13df5b1f 100644 --- a/src/xdgshellwindow.cpp +++ b/src/xdgshellwindow.cpp @@ -707,11 +707,13 @@ void XdgToplevelWindow::handleRolePrecommit() { auto configureEvent = static_cast(lastAcknowledgedConfigure()); if (configureEvent && decoration() != configureEvent->decoration.get()) { - connect(configureEvent->decoration.get(), &KDecoration2::Decoration::bordersChanged, this, [this]() { - if (!isDeleted()) { - scheduleConfigure(); - } - }); + if (configureEvent->decoration) { + connect(configureEvent->decoration.get(), &KDecoration2::Decoration::bordersChanged, this, [this]() { + if (!isDeleted()) { + scheduleConfigure(); + } + }); + } setDecoration(configureEvent->decoration); updateShadow();