winrt: Fix crash when clearing mimedata

Some autotests clear the clipboard by invoking setMimeData() with a null
QMimeData argument.

Change-Id: I4a9d3dfd41b2c52964e272fc1362162f47fd8cda
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
This commit is contained in:
Maurice Kalinowski 2016-08-23 10:37:54 +02:00
parent f1808e96c5
commit 4d07042c70

View File

@ -143,7 +143,7 @@ void QWinRTClipboard::setMimeData(QMimeData *data, QClipboard::Mode mode)
return;
#ifndef Q_OS_WINPHONE
const QString text = data->text();
const QString text = data ? data->text() : QString();
HRESULT hr = QEventDispatcherWinRT::runOnXamlThread([this, text]() {
HRESULT hr;
ComPtr<IDataPackage> package;