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,10 +69,12 @@ 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();
|
||||||
mod.setMetadata(new Metadata::ModStruct(*metadata));
|
if (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;
|
||||||
|
Loading…
Reference in New Issue
Block a user