Avoid a crash on pasting files to text edits
The mime data object fed to qWasmClipboardPaste in qClipboardPasteTo might have empty formats. We unconditionally check the first format nevertheless, which leads to a crash. Avoid feeding empty mime data to the widget system. Fixes: QTBUG-108840 Change-Id: If874e973b742d35c16cb8a87194d9d4b8f470801 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
This commit is contained in:
parent
d21b484354
commit
391e21d23d
@ -139,7 +139,8 @@ static void qClipboardPasteTo(val dataTransfer)
|
||||
} // next item
|
||||
}
|
||||
}
|
||||
qWasmClipboardPaste(mMimeData);
|
||||
if (!mMimeData->formats().isEmpty())
|
||||
qWasmClipboardPaste(mMimeData);
|
||||
}
|
||||
|
||||
EMSCRIPTEN_BINDINGS(qtClipboardModule) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user