selection: Return an error if trying to transfer from NULL source

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2364>
This commit is contained in:
Jonas Ådahl 2022-04-06 10:04:05 +02:00 committed by Marge Bot
parent c9e7cf4ea1
commit 6c0a917832

View File

@ -438,6 +438,13 @@ meta_selection_transfer_async (MetaSelection *selection,
task = g_task_new (selection, cancellable, callback, user_data);
g_task_set_source_tag (task, meta_selection_transfer_async);
if (!selection->owners[selection_type])
{
g_task_return_new_error (task, G_IO_ERROR, G_IO_ERROR_NOT_FOUND,
"Tried to transfer from NULL selection source");
return;
}
transfer_request = transfer_request_new (output, selection_type, size,
cancellable);