Add assert for dynamic_cast (#626)

This commit is contained in:
Christian Semmler 2025-07-18 15:06:47 -07:00 committed by GitHub
parent 55a3ad71c6
commit 6b551b14c0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -80,10 +80,7 @@ MxBool MxControlPresenter::CheckButtonDown(MxS32 p_x, MxS32 p_y, MxPresenter* p_
{
assert(p_presenter);
MxVideoPresenter* presenter = dynamic_cast<MxVideoPresenter*>(p_presenter);
if (!presenter) {
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Invalid presenter");
return FALSE;
}
assert(presenter);
if (m_style == e_map) {
MxStillPresenter* map = (MxStillPresenter*) m_list.front();