Guard against undefined alert message