protocols/compositor: fix null deref on unassigned surface image desc

ref #12603
This commit is contained in:
Vaxry 2025-12-08 22:49:53 +00:00
parent 920353370b
commit efe665b455
Signed by: vaxry
GPG key ID: 665806380871D640

View file

@ -558,7 +558,7 @@ void CWLSurfaceResource::commitState(SSurfaceState& state) {
SImageDescription CWLSurfaceResource::getPreferredImageDescription() {
static const auto PFORCE_HDR = CConfigValue<Hyprlang::INT>("quirks:prefer_hdr");
const auto WINDOW = Desktop::View::CWindow::fromView(m_hlSurface->view());
const auto WINDOW = m_hlSurface ? Desktop::View::CWindow::fromView(m_hlSurface->view()) : nullptr;
if (*PFORCE_HDR == 1 || (*PFORCE_HDR == 2 && m_hlSurface && WINDOW && WINDOW->m_class == "gamescope"))
return g_pCompositor->getHDRImageDescription();