Skip to content

Commit

Permalink
Always create an empty vardict instead of passing NULL
Browse files Browse the repository at this point in the history
In the error case, we will clear the GVariant and then try to emit a
response from a NULL pointer as result. Always create an empty vardict
when something failed instead.

This also clears the error because we continue on in the error case and
do in fact re-using it in one case.
  • Loading branch information
swick committed Oct 4, 2024
1 parent ac5f7d8 commit 2c9a981
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
5 changes: 3 additions & 2 deletions src/input-capture.c
Original file line number Diff line number Diff line change
Expand Up @@ -473,16 +473,17 @@ set_pointer_barriers_done (GObject *source_object,
&results,
res,
&error))
{
{
g_dbus_error_strip_remote_error (error);
g_warning ("A backend call failed: %s", error->message);
g_clear_error (&error);
}

should_close_session = !request->exported || response != 0;

if (request->exported)
{
if (response != 0)
if (!results)
{
GVariantBuilder results_builder;

Expand Down
5 changes: 4 additions & 1 deletion src/remote-desktop.c
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,7 @@ select_devices_done (GObject *source_object,
{
g_dbus_error_strip_remote_error (error);
g_warning ("A backend call failed: %s", error->message);
g_clear_error (&error);
}

should_close_session = !request->exported || response != 0;
Expand Down Expand Up @@ -664,6 +665,7 @@ start_done (GObject *source_object,
{
g_dbus_error_strip_remote_error (error);
g_warning ("A backend call failed: %s", error->message);
g_clear_error (&error);
}

should_close_session = !request->exported || response != 0;
Expand All @@ -682,7 +684,8 @@ start_done (GObject *source_object,
should_close_session = TRUE;
}
}
else

if (!results)
{
GVariantBuilder results_builder;

Expand Down

0 comments on commit 2c9a981

Please sign in to comment.