Skip to content

Commit 206575a

Browse files
authored
Merge pull request #67 from JorenV/master
php 7.2 compatibility
2 parents 4713b36 + 0aa25d1 commit 206575a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/API.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ public static function add_to_request_cache( $api_request_hash, $result ) {
158158

159159
// If the cache array is larger than 50, snip the first item. This may be increased in future
160160

161-
if ( count( self::$request_cache ) > 50 ) {
161+
if ( !empty(self::$request_cache) && (count( self::$request_cache ) > 50) ) {
162162
array_shift( self::$request_cache );
163163
}
164164

0 commit comments

Comments
 (0)