diff --git a/src/menu/doommenu.cpp b/src/menu/doommenu.cpp index 7fec2e5fd9..24fb66cfbb 100644 --- a/src/menu/doommenu.cpp +++ b/src/menu/doommenu.cpp @@ -1304,7 +1304,17 @@ void SetDefaultMenuColors() OptionSettings.mFontColorHighlight = V_FindFontColor(gameinfo.mFontColorHighlight); OptionSettings.mFontColorSelection = V_FindFontColor(gameinfo.mFontColorSelection); - auto cls = PClass::FindClass(gameinfo.MenuDelegateClass); + auto cls = PClass::FindClass(gameinfo.HelpMenuClass); + if (!cls) + I_FatalError("%s: Undefined help menu class", gameinfo.HelpMenuClass.GetChars()); + if (!cls->IsDescendantOf(RUNTIME_CLASS(DMenu))) + I_FatalError("'%s' does not inherit from Menu", gameinfo.HelpMenuClass.GetChars()); + + cls = PClass::FindClass(gameinfo.MenuDelegateClass); + if (!cls) + I_FatalError("%s: Undefined menu delegate class", gameinfo.HelpMenuClass.GetChars()); + if (!cls->IsDescendantOf("MenuDelegateBase")) + I_FatalError("'%s' does not inherit from MenuDelegateBase", gameinfo.MenuDelegateClass.GetChars()); menuDelegate = cls->CreateNew(); }