From dd2312ddc8654cc35bd9480c06af3cc7d585fdce Mon Sep 17 00:00:00 2001 From: Aaron Parecki Date: Fri, 6 Jan 2017 09:09:41 -0800 Subject: check for errors from xray --- controllers/controllers.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'controllers') diff --git a/controllers/controllers.php b/controllers/controllers.php index 1c3db83..4f150ce 100644 --- a/controllers/controllers.php +++ b/controllers/controllers.php @@ -437,7 +437,7 @@ $app->get('/reply/preview', function() use($app) { curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $response = curl_exec($ch); $data = @json_decode($response, true); - if($data && $data['data']['type'] == 'entry') { + if($data && isset($data['data']) && $data['data']['type'] == 'entry') { $entry = $data['data']; // Create a nickname based on the author URL if(array_key_exists('author', $entry) && $entry['author']['url']) { -- cgit v1.2.3