fix(QClipboardProxy): check if mimedata is not null
Pointer returned by QClipboard::mimeData may be null, e.g. during tests in headless mode, causing segfault.
This commit is contained in:
parent
cd870a2e56
commit
0caec2ab1c
|
@ -36,7 +36,8 @@ bool QClipboardProxy::hasHtml() const
|
||||||
|
|
||||||
QString QClipboardProxy::html() const
|
QString QClipboardProxy::html() const
|
||||||
{
|
{
|
||||||
return m_clipboard->mimeData()->html();
|
auto mimeData = m_clipboard->mimeData();
|
||||||
|
return mimeData ? mimeData->html() : QString{};
|
||||||
}
|
}
|
||||||
|
|
||||||
bool QClipboardProxy::hasImage() const
|
bool QClipboardProxy::hasImage() const
|
||||||
|
|
Loading…
Reference in New Issue