Implement the field exists check. This is the '@' token on the left hand side of '&&' in the expression below.

$.menu.items[?(@ && @.id == 'ViewSVG')].id