fixed NPE in AlertDialog
(cherry picked from commit c354876)
fixed NPE in AlertDialog
(cherry picked from commit 851f9c8)
fixed syntax error