diff --git a/changelog/next.md b/changelog/next.md index 5a6954c..aaeaf1c 100644 --- a/changelog/next.md +++ b/changelog/next.md @@ -1,3 +1,4 @@ ## Bug Fixes - Fixed ScreencopyView not displaying when only lock surfaces are shown. +- Fixed WlSessionLockSurface.visible crashing if accessed before backing surface creation. diff --git a/src/wayland/session_lock.cpp b/src/wayland/session_lock.cpp index 95f6ccf..3b908b8 100644 --- a/src/wayland/session_lock.cpp +++ b/src/wayland/session_lock.cpp @@ -274,7 +274,10 @@ void WlSessionLockSurface::show() { QQuickItem* WlSessionLockSurface::contentItem() const { return this->mContentItem; } -bool WlSessionLockSurface::isVisible() const { return this->window->isVisible(); } +bool WlSessionLockSurface::isVisible() const { + if (this->window == nullptr) return false; + return this->window->isVisible(); +} qint32 WlSessionLockSurface::width() const { if (this->window == nullptr) return 0;