diff --git a/fblikes.snippet.php b/fblikes.snippet.php index d0b8faa..900b002 100644 --- a/fblikes.snippet.php +++ b/fblikes.snippet.php @@ -43,6 +43,9 @@ $graphdata = file_get_contents("http://graph.facebook.com/".$pageid); // decode json response $response = $modx->fromJSON($graphdata); + if (!$response || !is_array($response) || !isset($response['likes'])) { + return 'Data currently not available.'; + } // get like number $data = $response['likes'];