Resolves: tdf#145863 crash if popup closed before becoming truly visible

the timing has to be just right to get this to happen

Change-Id: I1ae81bf5c79b7f8b3fdf82b3fab94d5a3b6076cc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125816
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
diff --git a/sc/source/ui/cctrl/checklistmenu.cxx b/sc/source/ui/cctrl/checklistmenu.cxx
index 05bd1cc..e88d991 100644
--- a/sc/source/ui/cctrl/checklistmenu.cxx
+++ b/sc/source/ui/cctrl/checklistmenu.cxx
@@ -1400,7 +1400,8 @@ void ScCheckListMenuControl::setPopupEndAction(Action* p)

IMPL_LINK_NOARG(ScCheckListMenuControl, PopupModeEndHdl, weld::Popover&, void)
{
    clearSelectedMenuItem();
    if (mxMenu)
        clearSelectedMenuItem();
    if (mxPopupEndAction)
        mxPopupEndAction->execute();