From 0e9f5ae28715dea40a9059b020760e3f509a991d Mon Sep 17 00:00:00 2001 From: Daniel Bachhuber Date: Mon, 17 Aug 2020 13:58:51 -0700 Subject: [PATCH] Make sure `$results` is an array before trying to get its values --- object-cache.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/object-cache.php b/object-cache.php index 7453648..537a516 100644 --- a/object-cache.php +++ b/object-cache.php @@ -702,7 +702,7 @@ public function get_multiple( $keys, $group = 'default', $force = false ) { if ( $this->_should_use_redis_hashes( $group ) ) { $redis_safe_group = $this->_key( '', $group ); $results = $this->_call_redis( 'hmGet', $redis_safe_group, $remaining_keys ); - $results = array_values( $results ); + $results = is_array( $results ) ? array_values( $results ) : $results; } else { $ids = array(); foreach ( $remaining_keys as $key ) {