Statement throws "Cannot read property 'count' of null" when response is...

If lookup fails and the response is null, a javascript error is returned and the loading spinner goes forever.