clipboard: don't crash if the source client does not send a mime type

Reviewed-by: Daniel Stone <daniels@collabora.com>
This commit is contained in:
Giulio Camuffo 2015-05-01 00:13:55 +03:00 committed by Daniel Stone
parent 4c93c08679
commit 6a94a99f39

View file

@ -254,7 +254,7 @@ clipboard_set_selection(struct wl_listener *listener, void *data)
mime_types = source->mime_types.data;
if (pipe2(p, O_CLOEXEC) == -1)
if (!mime_types || pipe2(p, O_CLOEXEC) == -1)
return;
source->send(source, mime_types[0], p[1]);