Fix warning about nullptr sender in QObject::connect()

When one sets "no border" property, the decoration can be null.
This commit is contained in:
Vlad Zahorodnii 2024-03-20 14:49:20 +02:00
parent 236baa63df
commit 012c64b054

View file

@ -707,11 +707,13 @@ void XdgToplevelWindow::handleRolePrecommit()
{ {
auto configureEvent = static_cast<XdgToplevelConfigure *>(lastAcknowledgedConfigure()); auto configureEvent = static_cast<XdgToplevelConfigure *>(lastAcknowledgedConfigure());
if (configureEvent && decoration() != configureEvent->decoration.get()) { if (configureEvent && decoration() != configureEvent->decoration.get()) {
if (configureEvent->decoration) {
connect(configureEvent->decoration.get(), &KDecoration2::Decoration::bordersChanged, this, [this]() { connect(configureEvent->decoration.get(), &KDecoration2::Decoration::bordersChanged, this, [this]() {
if (!isDeleted()) { if (!isDeleted()) {
scheduleConfigure(); scheduleConfigure();
} }
}); });
}
setDecoration(configureEvent->decoration); setDecoration(configureEvent->decoration);
updateShadow(); updateShadow();