Skip to content

Commit f46af36

Browse files
committed
Fixed crash that could occur if disabling a mod mid-session (like you should ever do that anyways... hmm)
1 parent 6921f78 commit f46af36

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Source/Managers/PresetMan.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,8 @@ const Entity* PresetMan::GetEntityPreset(const std::string& typeName, std::strin
131131
}
132132
} else {
133133
// Try to get it from the asked for module
134-
pRetEntity = g_ModuleMan.GetDataModule(whichModule)->GetEntityPreset(typeName, presetName);
134+
DataModule* dataModule = g_ModuleMan.GetDataModule(whichModule);
135+
pRetEntity = dataModule ? dataModule->GetEntityPreset(typeName, presetName) : nullptr;
135136

136137
// If couldn't find it in there, then try all the official modules!
137138
if (!pRetEntity) {

0 commit comments

Comments
 (0)