[AppletInterface] Check for corona before accessing it

On plasmashell shutdown when the panels are destroyed, the available screen geometry changes.
When an applet then accesses screenGeometry in response to that change, it crashes because the corona is already gone.

availableScreenRegion() and availableScreenRect() already checked for this but screenGeometry() did not

Differential Revision: https://phabricator.kde.org/D20244
This commit is contained in:
Kai Uwe Broulik 2019-04-05 11:34:07 +02:00
parent 9de0def99f
commit c65145bd34

View File

@ -574,7 +574,7 @@ int AppletInterface::screen() const
QRect AppletInterface::screenGeometry() const
{
if (!applet() || !applet()->containment()) {
if (!applet() || !applet()->containment() || !applet()->containment()->corona()) {
return QRect();
}
return applet()->containment()->corona()->screenGeometry(applet()->containment()->screen());