Skip to content

Commit 3ea0b08

Browse files
authored
Merge pull request #3 from brummbar/handle-empty-responses
Handle 200 OK responses with an empty or non-json body.
2 parents e78f36c + 1927ea8 commit 3ea0b08

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/QueryResult.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public function hasError()
7878
// but the body of the response will contain the string "error" in the
7979
// "result" parameter.
8080
// @see https://github.com/matomo/matomo/issues/7293
81-
return $this->isObject() && $this->parameterExists('result') && $this->get('result') === 'error';
81+
return !$this->isObject() || $this->parameterExists('result') && $this->get('result') === 'error';
8282
}
8383

8484
/**

0 commit comments

Comments
 (0)