clipboard-manager: Make sure we always have mimetype
The precondition checks in meta_selection_source_memory_new can return NULL if the mimetype is NULL but callers expect the error to be set when NULL is returned. Let's just make sure we never call it with a NULL mimetype. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3678>
This commit is contained in:
parent
5dfed8a431
commit
ce32d2b77a
@ -126,7 +126,7 @@ owner_changed_cb (MetaSelection *selection,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (best_idx < 0)
|
if (!best)
|
||||||
{
|
{
|
||||||
g_list_free_full (mimetypes, g_free);
|
g_list_free_full (mimetypes, g_free);
|
||||||
return;
|
return;
|
||||||
@ -149,6 +149,8 @@ owner_changed_cb (MetaSelection *selection,
|
|||||||
g_autoptr (GError) error = NULL;
|
g_autoptr (GError) error = NULL;
|
||||||
g_autoptr (MetaSelectionSource) new_source = NULL;
|
g_autoptr (MetaSelectionSource) new_source = NULL;
|
||||||
|
|
||||||
|
g_assert (display->saved_clipboard_mimetype != NULL);
|
||||||
|
|
||||||
/* Old owner is gone, time to take over */
|
/* Old owner is gone, time to take over */
|
||||||
new_source = meta_selection_source_memory_new (display->saved_clipboard_mimetype,
|
new_source = meta_selection_source_memory_new (display->saved_clipboard_mimetype,
|
||||||
display->saved_clipboard,
|
display->saved_clipboard,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user