Skip to content
Snippets Groups Projects
Unverified Commit 330cb704 authored by Julius Härtl's avatar Julius Härtl
Browse files

Do not call count on null


Signed-off-by: default avatarJulius Härtl <jus@bitgrid.net>
parent a6ae8012
No related branches found
No related tags found
No related merge requests found
...@@ -256,8 +256,12 @@ class CommentsContext implements \Behat\Behat\Context\Context { ...@@ -256,8 +256,12 @@ class CommentsContext implements \Behat\Behat\Context\Context {
* @throws \Exception * @throws \Exception
*/ */
public function theResponseShouldContainOnlyComments($number) { public function theResponseShouldContainOnlyComments($number) {
if (count($this->response) !== (int)$number) { $count = 0;
throw new \Exception("Found more comments than $number (" . count($this->response) . ")"); if ($this->response !== null) {
$count = count($this->response);
}
if ($count !== (int)$number) {
throw new \Exception("Found more comments than $number (" . $count . ")");
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment