Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions src/modules/capture/capture.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (C) 2024 UnionTech Software Technology Co., Ltd.
// Copyright (C) 2024-2026 UnionTech Software Technology Co., Ltd.
// SPDX-License-Identifier: Apache-2.0 OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only

#include "capture.h"
Expand Down Expand Up @@ -580,7 +580,10 @@ void CaptureSourceSelector::doneSelection()
this,
&CaptureSourceSelector::createImage);
m_internalContentItem->setVisible(false);
m_canvas->surfaceItem()->setSubsurfacesVisible(false);
// m_canvas may be null when no mask surface exists (e.g. capture via
// xdg-desktop-portal without a mask). Guard against null dereference.
if (m_canvas && m_canvas->surfaceItem())
m_canvas->surfaceItem()->setSubsurfacesVisible(false);
}

void CaptureSourceSelector::cancelSelection()
Expand Down
Loading