From 5e31fbed624106e8021fedeec347826ea3f63b74 Mon Sep 17 00:00:00 2001
From: Demian Katz <demian.katz@villanova.edu>
Date: Fri, 3 Nov 2017 12:52:29 -0400
Subject: [PATCH] Fix bug: error on blank BrowZine search.

---
 .../src/VuFindSearch/Backend/BrowZine/Backend.php           | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/module/VuFindSearch/src/VuFindSearch/Backend/BrowZine/Backend.php b/module/VuFindSearch/src/VuFindSearch/Backend/BrowZine/Backend.php
index 2ff160bc46a..ca34144ca20 100644
--- a/module/VuFindSearch/src/VuFindSearch/Backend/BrowZine/Backend.php
+++ b/module/VuFindSearch/src/VuFindSearch/Backend/BrowZine/Backend.php
@@ -107,11 +107,13 @@ class Backend extends AbstractBackend
                 $e
             );
         }
+        $results = isset($response['data']) && is_array($response['data'])
+            ? $response['data'] : [];
         $collection = $this->createRecordCollection(
             [
                 'offset' => $offset,
-                'recordCount' => count($response['data']),
-                'data' => array_slice($response['data'], $offset, $limit)
+                'recordCount' => count($results),
+                'data' => array_slice($results, $offset, $limit)
             ]
         );
         $this->injectSourceIdentifier($collection);
-- 
GitLab