Skip to content

Commit

Permalink
Merge pull request #3 from brummbar/handle-empty-responses
Browse files Browse the repository at this point in the history
Handle 200 OK responses with an empty or non-json body.
  • Loading branch information
pfrenssen authored Aug 14, 2018
2 parents e78f36c + 1927ea8 commit 3ea0b08
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/QueryResult.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public function hasError()
// but the body of the response will contain the string "error" in the
// "result" parameter.
// @see https://github.com/matomo/matomo/issues/7293
return $this->isObject() && $this->parameterExists('result') && $this->get('result') === 'error';
return !$this->isObject() || $this->parameterExists('result') && $this->get('result') === 'error';
}

/**
Expand Down

0 comments on commit 3ea0b08

Please sign in to comment.