Make the leaflet client test for variable existence in alerts, before accessing them