Fix potential crash if there is no image format pasted

macos-qt
Nicolas Werner 3 years ago
parent 15ff5dace5
commit 5734641778
No known key found for this signature in database
GPG Key ID: C8D75E610773F2D9
  1. 3
      src/timeline/InputBar.cpp

@ -155,7 +155,8 @@ InputBar::insertMimeData(const QMimeData *md)
if (md->hasImage()) { if (md->hasImage()) {
if (formats.contains(QStringLiteral("image/svg+xml"), Qt::CaseInsensitive)) { if (formats.contains(QStringLiteral("image/svg+xml"), Qt::CaseInsensitive)) {
startUploadFromMimeData(*md, QStringLiteral("image/svg+xml")); startUploadFromMimeData(*md, QStringLiteral("image/svg+xml"));
} else if (formats.contains(QStringLiteral("image/png"), Qt::CaseInsensitive)) { } else if (formats.contains(QStringLiteral("image/png"), Qt::CaseInsensitive) ||
formats.empty()) {
startUploadFromMimeData(*md, QStringLiteral("image/png")); startUploadFromMimeData(*md, QStringLiteral("image/png"));
} else { } else {
startUploadFromMimeData(*md, image.first()); startUploadFromMimeData(*md, image.first());

Loading…
Cancel
Save