st/clipboard: Pass non-NULL mimetype to SelectionSourceMemory

meta_selection_source_memory_new previously had some precondition checks
which would return NULL if the mimetype is NULL but now that it returns
an error we can't do that anymore.

Move the precondition checks to the caller instead.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3260>
This commit is contained in:
Sebastian Wick 2024-04-02 13:20:20 +02:00 committed by Marge Bot
parent 8df0ccd090
commit 0586158389

View File

@ -302,6 +302,7 @@ st_clipboard_set_content (StClipboard *clipboard,
g_return_if_fail (ST_IS_CLIPBOARD (clipboard)); g_return_if_fail (ST_IS_CLIPBOARD (clipboard));
g_return_if_fail (meta_selection != NULL); g_return_if_fail (meta_selection != NULL);
g_return_if_fail (bytes != NULL); g_return_if_fail (bytes != NULL);
g_return_if_fail (mimetype != NULL);
if (!convert_type (type, &selection_type)) if (!convert_type (type, &selection_type))
return; return;