f8a3636374
block and layout could be NULL and checking this everywhere wasn't practical. Instead of lazy initializing, add UI_popup_menu_end_or_cancel which cancels empty popup menus.