I think the code in question is this line:
$FCSTJSON = $rawJSON['properties']; // geoJSON format
If you get an error on the fetch, 'properties' may not be set. I ran into this a while ago and modified it to:
if (isset($rawJSON['properties']) )
$FCSTJSON = $rawJSON['properties']; // geoJSON format