Fix nullpointerexception:make sure dialog is not null
Merge pull request #31 from hijamoya/exception

Fix nullpointerexception:make sure dialog is not null