From 29e5864402c0ca8622c05fd6b1b4a24c62f35d6c Mon Sep 17 00:00:00 2001 From: Xaver Hugl Date: Tue, 9 Nov 2021 22:05:50 +0100 Subject: [PATCH] waylandserver: fix logout crash When we shut down we can have zero outputs, and thus a nullptr primary output. --- src/wayland_server.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wayland_server.cpp b/src/wayland_server.cpp index be782e4b22..0fc68b2acd 100644 --- a/src/wayland_server.cpp +++ b/src/wayland_server.cpp @@ -276,7 +276,7 @@ void WaylandServer::initPlatform() connect(kwinApp()->platform(), &Platform::outputDisabled, this, &WaylandServer::handleOutputDisabled); connect(kwinApp()->platform(), &Platform::primaryOutputChanged, this, [this] (AbstractOutput *primaryOutput) { - m_primary->setPrimaryOutput(primaryOutput->name()); + m_primary->setPrimaryOutput(primaryOutput ? primaryOutput->name() : ""); }); if (auto primaryOutput = kwinApp()->platform()->primaryOutput()) { m_primary->setPrimaryOutput(primaryOutput->name());