diff --git a/module/VuFind/src/VuFind/Controller/Plugin/ResultScroller.php b/module/VuFind/src/VuFind/Controller/Plugin/ResultScroller.php
index a9e560a7868fceae908b16216416e3572176dc5a..cc6caabf64afe9e08405c54266f306e590416f28 100644
--- a/module/VuFind/src/VuFind/Controller/Plugin/ResultScroller.php
+++ b/module/VuFind/src/VuFind/Controller/Plugin/ResultScroller.php
@@ -203,7 +203,9 @@ class ResultScroller extends AbstractPlugin
 
                     // if there is something on the next page, then the next
                     // record is the first record on the next page
-                    if (!empty($this->data->nextIds)) {
+                    if (is_array($this->data->nextIds)
+                        && count($this->data->nextIds) > 0
+                    ) {
                         $retVal['nextRecord'] = $this->data->nextIds[0];
                     }