From 378e4830aca3784b4d474cfaabee59f647634163 Mon Sep 17 00:00:00 2001 From: Marco Allegretti Date: Mon, 4 May 2026 08:43:15 +0200 Subject: [PATCH] Guard convergentwindows against invalid windows Return early in run(window) when the window object is null, deleted, or non-normal before accessing resourceClass. This prevents runtime errors during window lifecycle races. --- kwin/scripts/convergentwindows/contents/ui/main.qml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/kwin/scripts/convergentwindows/contents/ui/main.qml b/kwin/scripts/convergentwindows/contents/ui/main.qml index deb73722..eadc6cb0 100644 --- a/kwin/scripts/convergentwindows/contents/ui/main.qml +++ b/kwin/scripts/convergentwindows/contents/ui/main.qml @@ -53,13 +53,13 @@ Loader { } function run(window) { - // HACK: don't maximize xwaylandvideobridge - // see: https://invent.kde.org/plasma/plasma-mobile/-/issues/324 - if (window.resourceClass === 'xwaylandvideobridge') { + if (!window || window.deleted || !window.normalWindow) { return; } - if (!window.normalWindow) { + // HACK: don't maximize xwaylandvideobridge + // see: https://invent.kde.org/plasma/plasma-mobile/-/issues/324 + if (window.resourceClass === 'xwaylandvideobridge') { return; }