mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-11-25 12:38:48 +03:00
Fix potential crash if there is no image format pasted
This commit is contained in:
parent
15ff5dace5
commit
5734641778
1 changed files with 2 additions and 1 deletions
|
@ -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());
|
||||
|
|
Loading…
Reference in a new issue