Handling API that returns a null

I'm sure this has been asked before but I can't find the answer here, so hopefully someone can give me some pointers.

How can I handle that dreaded red screen when a JSON API (Post) returns a null value? I've got a dropdown that works great when the JSON object has values, but it craps out when a null is returned. For the life of me, I can't find a solution.

Cheers in advance

5
7 replies