Avoid one attribute check in Menu.
(cherry picked from commit 2c301f5)