If api_result is null or undefined, then it return right away by the next line. So, I think that not a problem.