Fix NPE when loading menu. (backported to 1.5.6 release as well)