summary refs log tree commit diff
diff options
context:
space:
mode:
authorNicolas Werner <nicolas.werner@hotmail.de>2022-03-21 22:54:44 +0100
committerNicolas Werner <nicolas.werner@hotmail.de>2022-03-21 22:54:44 +0100
commit5734641778ef2350c7ed1e22cbd3b8f69ae6ec07 (patch)
treef72b953b3d5b406a9809bdf389e16d4cbe393da9
parentMerge pull request #1008 from Nheko-Reborn/new-upload (diff)
downloadnheko-5734641778ef2350c7ed1e22cbd3b8f69ae6ec07.tar.xz
Fix potential crash if there is no image format pasted
-rw-r--r--src/timeline/InputBar.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/timeline/InputBar.cpp b/src/timeline/InputBar.cpp
index e1223021..bf8f926a 100644
--- a/src/timeline/InputBar.cpp
+++ b/src/timeline/InputBar.cpp
@@ -155,7 +155,8 @@ InputBar::insertMimeData(const QMimeData *md)
     if (md->hasImage()) {
         if (formats.contains(QStringLiteral("image/svg+xml"), Qt::CaseInsensitive)) {
             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"));
         } else {
             startUploadFromMimeData(*md, image.first());