Skip to content

Commit e05c3b6

Browse files
chore: improve cache handling logic
1 parent 3cd158b commit e05c3b6

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Caches/RESTAPIVersionReleasesCache.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class RESTAPIVersionReleasesCache extends Cache {
3333
$releases = json_decode($releases_json, true);
3434

3535
# If we don't have an 'assets' key, the response is invalid. Log the response, keep the existing cache
36-
if (!is_array($releases) or !array_key_exists('assets', $releases)) {
36+
if (!is_array($releases) or !array_key_exists(0, $releases) or !array_key_exists('assets', $releases[0])) {
3737
Cache::log(
3838
level: LOG_ERR,
3939
message: "Releases data is malformed, received $releases_json. Keeping existing cache.",

0 commit comments

Comments
 (0)