From 65fe6b864d5bd5e49d2e0b021823d97ea377e545 Mon Sep 17 00:00:00 2001 From: Dominic Hayes Date: Sat, 9 Jul 2022 22:14:45 +0000 Subject: [PATCH] Fix "PanelSpacer::containmentGraphicObject()" plasmashell segfault This one-liner fix is from Aleix Pol, and fixes the following: - Crashes when deleting panels with Panel Spacer instances on them (as described in the bug ID named above) - Potentially endless crash looping when running `plasmashell --replace` while a Panel Spacer is on at least one panel Co-authored-by: Aleix Pol BUG: 450663 FIXED-IN: 5.25.3 --- applets/panelspacer/plugin/panelspacer.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/applets/panelspacer/plugin/panelspacer.cpp b/applets/panelspacer/plugin/panelspacer.cpp index 8d7a75b06..49e314b14 100644 --- a/applets/panelspacer/plugin/panelspacer.cpp +++ b/applets/panelspacer/plugin/panelspacer.cpp @@ -122,6 +122,7 @@ PlasmaQuick::AppletQuickItem *PanelSpacer::twinSpacer() const PlasmaQuick::AppletQuickItem *PanelSpacer::containmentGraphicObject() const { + if (!containment()) return nullptr; // Return nothing if there is no containment to prevent a Segmentation Fault return containment()->property("_plasma_graphicObject").value(); }