Skip to content

Commit 690fa8f

Browse files
committed
Updated JSON decode check in compile function
1 parent b22e9c8 commit 690fa8f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Symfony/src/Codebender/BuilderBundle/Controller/DefaultController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ protected function compile($contents)
9999
$data = $apiHandler->postRawData($this->container->getParameter('compiler'), $compilerRequestContent);
100100

101101
$decodedResponse = json_decode($data, true);
102-
if ($decodedResponse === NULL) {
102+
if (json_last_error() !== JSON_ERROR_NONE) {
103103
return json_encode(array("success" => false, "message"=> "Failed to get compiler response."));
104104
}
105105

0 commit comments

Comments
 (0)