Fixed crash by null pointer at AlertType