fix: segfault when the same mod is present enabled and disabled at once
This maintains the previous behaviour
This commit is contained in:
parent
9f1f37e780
commit
4448418b63
@ -69,11 +69,13 @@ void ModFolderLoadTask::run()
|
|||||||
m_result->mods[mod.internal_id()] = mod;
|
m_result->mods[mod.internal_id()] = mod;
|
||||||
|
|
||||||
auto metadata = m_result->mods[chopped_id].metadata();
|
auto metadata = m_result->mods[chopped_id].metadata();
|
||||||
|
if (metadata) {
|
||||||
mod.setMetadata(new Metadata::ModStruct(*metadata));
|
mod.setMetadata(new Metadata::ModStruct(*metadata));
|
||||||
|
|
||||||
m_result->mods[mod.internal_id()].setStatus(ModStatus::Installed);
|
m_result->mods[mod.internal_id()].setStatus(ModStatus::Installed);
|
||||||
m_result->mods.remove(chopped_id);
|
m_result->mods.remove(chopped_id);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
m_result->mods[mod.internal_id()] = mod;
|
m_result->mods[mod.internal_id()] = mod;
|
||||||
m_result->mods[mod.internal_id()].setStatus(ModStatus::NoMetadata);
|
m_result->mods[mod.internal_id()].setStatus(ModStatus::NoMetadata);
|
||||||
|
Loading…
Reference in New Issue
Block a user