diff --git a/launcher/minecraft/mod/ResourceFolderModel.h b/launcher/minecraft/mod/ResourceFolderModel.h index d763bec3..5652c156 100644 --- a/launcher/minecraft/mod/ResourceFolderModel.h +++ b/launcher/minecraft/mod/ResourceFolderModel.h @@ -257,8 +257,11 @@ void ResourceFolderModel::applyUpdates(QSet& current_set, QSet // If the resource is resolving, but something about it changed, we don't want to // continue the resolving. if (current_resource->isResolving()) { - auto task = (*m_active_parse_tasks.find(current_resource->resolutionTicket())).get(); - task->abort(); + auto ticket = current_resource->resolutionTicket(); + if (m_active_parse_tasks.contains(ticket)) { + auto task = (*m_active_parse_tasks.find(ticket)).get(); + task->abort(); + } } m_resources[row].reset(new_resource); @@ -285,8 +288,11 @@ void ResourceFolderModel::applyUpdates(QSet& current_set, QSet Q_ASSERT(removed_set.contains(removed_it->get()->internal_id())); if ((*removed_it)->isResolving()) { - auto task = (*m_active_parse_tasks.find((*removed_it)->resolutionTicket())).get(); - task->abort(); + auto ticket = (*removed_it)->resolutionTicket(); + if (m_active_parse_tasks.contains(ticket)) { + auto task = (*m_active_parse_tasks.find(ticket)).get(); + task->abort(); + } } beginRemoveRows(QModelIndex(), removed_index, removed_index);