Handled null pointer exception.