fix crash when setting invalid menusections with lua