diff --git a/build/integration/features/bootstrap/CommentsContext.php b/build/integration/features/bootstrap/CommentsContext.php
index ce05b56689d8a3b05ac7cef2e8a4e26adce33314..262ffc92b88482a0696c10073e9a31cc0a3f44f5 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 . ")");
 		}
 	}