Fix clipboard image pasting crash on macos

This commit is contained in:
Joseph Donofry 2020-10-28 20:47:39 -04:00
parent 2143881997
commit 0a004b87de
No known key found for this signature in database
GPG key ID: E8A1D78EF044B0CB

View file

@ -370,7 +370,7 @@ FilteredTextEdit::insertFromMimeData(const QMimeData *source)
const auto audio = formats.filter("audio/", Qt::CaseInsensitive);
const auto video = formats.filter("video/", Qt::CaseInsensitive);
if (source->hasImage()) {
if (!image.empty() && source->hasImage()) {
QImage img = qvariant_cast<QImage>(source->imageData());
previewDialog_.setPreview(img, image.front());
} else if (!audio.empty()) {