Why  (result==null) again? result is not null and that is why you were able to call result.isSuccess()