From: Laszlo Agocs Date: Tue, 10 May 2011 16:03:43 +0000 (+0200) Subject: Prevent crash in wayland mimedata in case there is no offer. X-Git-Tag: qt-v5.0.0-alpha1~222^2^2^2~23 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8cedc3b8b082c439709b649c5ffbe60f6365c04f;p=profile%2Fivi%2Fqtwayland.git Prevent crash in wayland mimedata in case there is no offer. --- diff --git a/src/plugins/platforms/wayland/qwaylandclipboard.cpp b/src/plugins/platforms/wayland/qwaylandclipboard.cpp index c1ac386..47ca228 100644 --- a/src/plugins/platforms/wayland/qwaylandclipboard.cpp +++ b/src/plugins/platforms/wayland/qwaylandclipboard.cpp @@ -199,6 +199,8 @@ void QWaylandClipboard::forceRoundtrip(struct wl_display *display) QVariant QWaylandClipboard::retrieveData(const QString &mimeType, QVariant::Type type) const { Q_UNUSED(type); + if (mOfferedMimeTypes.isEmpty() || !mOffer) + return QVariant(); int pipefd[2]; if (pipe(pipefd) == -1) { qWarning("QWaylandClipboard: pipe() failed");