FIX: crash on MediaFilePanel when download in empty list

Change-Id: I13f33005a8730498aea28b32da2818ceca055aac
This commit is contained in:
chunmao.guo 2022-09-01 11:14:55 +08:00 committed by Lane.Wei
parent 7184960dce
commit 0a7f696101
3 changed files with 13 additions and 4 deletions

View file

@ -138,7 +138,7 @@ void Slic3r::GUI::ImageGrid::DoAction(size_t index, int action)
if (action == 0) {
m_file_sys->DeleteFiles(index);
} else {
if (index >= 0) {
if (index != -1) {
auto &file = m_file_sys->GetFile(index);
if (file.IsDownload() && file.progress >= -1) {
if (file.progress >= 100) {