QIOSPasteboard: handle zero-pointer argument to setMimeData
QClipboard sends QPlatformClipboard a zero pointer to QMimeData when it's told to clear. So we need to check for this to avoid a crash. Change-Id: I570ed727029ca699673d7b2e989bdff44df8e161 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>bb10
parent
a14ec355c1
commit
8e7cb47a34
|
|
@ -205,6 +205,10 @@ void QIOSClipboard::setMimeData(QMimeData *mimeData, QClipboard::Mode mode)
|
|||
Q_ASSERT(supportsMode(mode));
|
||||
|
||||
UIPasteboard *pb = [UIPasteboard pasteboardWithQClipboardMode:mode];
|
||||
if (!mimeData) {
|
||||
pb.items = [NSArray array];
|
||||
return;
|
||||
}
|
||||
NSMutableDictionary *pbItem = [NSMutableDictionary dictionaryWithCapacity:mimeData->formats().size()];
|
||||
|
||||
foreach (const QString &mimeType, mimeData->formats()) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue