Implement NULL checkers to avoid dialog dismissal crashes
Error correction