From e683eb842e1db846b05ed4261c839e62862e3c70 Mon Sep 17 00:00:00 2001 From: Arno Date: Thu, 31 Mar 2016 12:45:33 +0200 Subject: Don't crash if we feed a non-picture to NewPicsDialog Actually use valid. Return when we get something else than an image. Otherwise we'd crash in ImageMagick::ping. --- newpicsdialog.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'newpicsdialog.cpp') diff --git a/newpicsdialog.cpp b/newpicsdialog.cpp index a86c566..b1b5842 100644 --- a/newpicsdialog.cpp +++ b/newpicsdialog.cpp @@ -338,6 +338,9 @@ void NewPicFilesModel::addFile(const QString &path){ if(haveMd5(md5)){ valid = false; } + if(!valid){ + return; + } QVariant picSize = Helper::picSize(fi.absoluteFilePath()); insertRows(0, 1, QModelIndex()); QModelIndex inserted = index(0, 1, QModelIndex()); -- cgit v1.2.3-70-g09d2