[danbooruservice] Check the blacklist outside the loop

Otherwise we keep on accessing a deleted post and we crash
This commit is contained in:
Luca Beltrame 2014-10-04 11:13:32 +02:00
parent fe630c753e
commit d99fd19d22

View file

@ -336,14 +336,22 @@ void DanbooruService::processPostList(KJob* job)
// second check, blacklist
bool inBlacklist = false;
for (auto tag: post->tags()) {
if (m_blacklist.contains(tag)) {
m_currentPosts--;
delete post;
continue;
inBlacklist = true;
break;
}
}
if (inBlacklist) {
m_currentPosts--;
delete post;
continue;
}
QPixmap pix;
// QPixmap* pix = new QPixmap();
bool result;