Skip to content

Fix crash when calling KHamburgerMenu::setMenuBar(nullptr)

Felix Ernst requested to merge (removed):fix_crash_for_nullptr_arg into master

KHamburgerMenu::setMenuBar() unconditionally calls m_menuBar->installEventFilter which crashes and doesn't make any sense when m_menuBar is nullptr. Aside from this KHamburgerMenu deals well with m_menuBar being nullptr.

m_menuBar is a QPointer so this should even prevent calls with an invalid pointer as the parameter from producing a crash.

Motivation:

I have stumbled upon this commit pim/korganizer@ab3eb22b that works around this crash. cc @vkrause

Edited by Felix Ernst

Merge request reports