summary refs log tree commit diff
path: root/src/Utils.cc
diff options
context:
space:
mode:
authorKonstantinos Sideris <sideris.konstantin@gmail.com>2018-05-18 21:27:44 +0300
committerKonstantinos Sideris <sideris.konstantin@gmail.com>2018-05-18 21:27:44 +0300
commit4ab42c68f464e62da3e46ca369753df7cd3eb628 (patch)
treefb207289750ae1498abc792fab8c671ff5bd0674 /src/Utils.cc
parentGenerate missing translations strings (diff)
downloadnheko-4ab42c68f464e62da3e46ca369753df7cd3eb628.tar.xz
Fix crash on unfinished animation & center the edit modal
Diffstat (limited to 'src/Utils.cc')
-rw-r--r--src/Utils.cc3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/Utils.cc b/src/Utils.cc

index f2e4b381..7b3574db 100644 --- a/src/Utils.cc +++ b/src/Utils.cc
@@ -145,6 +145,9 @@ utils::event_body(const mtx::events::collections::TimelineEvents &event) QPixmap utils::scaleImageToPixmap(const QImage &img, int size) { + if (img.isNull()) + return QPixmap(); + const int sz = QApplication::desktop()->screen()->devicePixelRatio() * size; return QPixmap::fromImage( img.scaled(sz, sz, Qt::IgnoreAspectRatio, Qt::SmoothTransformation));