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 <aleixpol@kde.org>

BUG: 450663
FIXED-IN: 5.25.3


(cherry picked from commit 65fe6b864d)
wilder-5.25
Dominic Hayes 4 years ago committed by Nate Graham
parent 627d6ab677
commit db0f5e68f2
  1. 1
      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<PlasmaQuick::AppletQuickItem *>();
}

Loading…
Cancel
Save