Commit da12d380 authored by Vlad Zahorodnii's avatar Vlad Zahorodnii

Fix a potential SIGSEGV

Compositor::self()->scene() may return nullptr while compositing is
being restarted.
parent cc8cb8db
......@@ -415,8 +415,12 @@ void Platform::warpPointer(const QPointF &globalPos)
bool Platform::supportsSurfacelessContext() const
{
if (Compositor *c = Compositor::self()) {
return c->scene()->supportsSurfacelessContext();
Compositor *compositor = Compositor::self();
if (Q_UNLIKELY(!compositor)) {
return false;
}
if (Scene *scene = compositor->scene()) {
return scene->supportsSurfacelessContext();
}
return false;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment