summaryrefslogtreecommitdiffstats
path: root/build
diff options
context:
space:
mode:
authorJulius Härtl <jus@bitgrid.net>2019-11-29 09:59:35 +0100
committerJulius Härtl <jus@bitgrid.net>2019-11-29 09:59:35 +0100
commit330cb7047e7160431bb6a3c6ec0c596d1ecd9b11 (patch)
treea911221b8167b843c6ed08b5453e9ffb358fa546 /build
parenta6ae8012ca8e03f075686aef44b6ee5b36efd0e4 (diff)
downloadnextcloud-server-330cb7047e7160431bb6a3c6ec0c596d1ecd9b11.tar.gz
nextcloud-server-330cb7047e7160431bb6a3c6ec0c596d1ecd9b11.zip
Do not call count on null
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Diffstat (limited to 'build')
-rw-r--r--build/integration/features/bootstrap/CommentsContext.php8
1 files changed, 6 insertions, 2 deletions
diff --git a/build/integration/features/bootstrap/CommentsContext.php b/build/integration/features/bootstrap/CommentsContext.php
index ce05b56689d..262ffc92b88 100644
--- a/build/integration/features/bootstrap/CommentsContext.php
+++ b/build/integration/features/bootstrap/CommentsContext.php
@@ -256,8 +256,12 @@ class CommentsContext implements \Behat\Behat\Context\Context {
* @throws \Exception
*/
public function theResponseShouldContainOnlyComments($number) {
- if (count($this->response) !== (int)$number) {
- throw new \Exception("Found more comments than $number (" . count($this->response) . ")");
+ $count = 0;
+ if ($this->response !== null) {
+ $count = count($this->response);
+ }
+ if ($count !== (int)$number) {
+ throw new \Exception("Found more comments than $number (" . $count . ")");
}
}