Commit 7b83e69d authored by Aleix Pol Gonzalez's avatar Aleix Pol Gonzalez 🐧 Committed by Aleix Pol Gonzalez
Browse files

ScreenCast: Streams can be closed while interacted with

This makes sure we do not crash.

BUG: 459693


(cherry picked from commit 73145576)
parent 6acba61c
Pipeline #237942 canceled with stage
......@@ -187,7 +187,7 @@ uint ScreenCastPortal::Start(const QDBusObjectPath &handle,
qCDebug(XdgDesktopPortalKdeScreenCast) << " parent_window: " << parent_window;
qCDebug(XdgDesktopPortalKdeScreenCast) << " options: " << options;
ScreenCastSession *session = qobject_cast<ScreenCastSession *>(Session::getSession(session_handle.path()));
QPointer<ScreenCastSession> session = qobject_cast<ScreenCastSession *>(Session::getSession(session_handle.path()));
if (!session) {
qCWarning(XdgDesktopPortalKdeScreenCast) << "Tried to call start on non-existing session " << session_handle.path();
......@@ -255,7 +255,7 @@ uint ScreenCastPortal::Start(const QDBusObjectPath &handle,
}
}
if (valid) {
if (valid && session) {
QVariantList outputs;
QStringList windows;
WaylandIntegration::Streams streams;
......
Supports Markdown
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