Skip to content

Commit

Permalink
fix: don't crash when downloading images while having no filename set
Browse files Browse the repository at this point in the history
  • Loading branch information
Bionus committed May 12, 2024
1 parent c9f1195 commit 415d2e7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/lib/src/downloader/image-downloader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,8 @@ void ImageDownloader::save()
// Try to build a path first if we don't need tags for the filename, to check for the "same dir" MD5 setting
const int filenameTagLevel = m_filename.needExactTags(m_image->parentSite(), m_profile->getSettings());
const bool filenameNeedExactTags = filenameTagLevel == 2 || (filenameTagLevel == 1 && m_image->hasUnknownTag());
const QString md5Path = !filenameNeedExactTags ? m_image->paths(m_filename, m_path, m_count).first() : QString();
const QStringList paths = m_image->paths(m_filename, m_path, m_count);
const QString md5Path = !filenameNeedExactTags && !paths.isEmpty() ? paths.first() : QString();

// We don't need to load the image details of files already in the MD5 list and that should be skipped
const QString md5action = m_profile->md5Action(m_image->md5(), md5Path).first;
Expand Down

0 comments on commit 415d2e7

Please # to comment.