Skip to content

Commit

Permalink
Fix caching error on Profile loading
Browse files Browse the repository at this point in the history
To reproduce this
1. Set Caching to level 3
2. Load the board index

Warning: Trying to access array offset on value of type bool in /Sources/User.php on line 5372
Warning: Undefined array key "" in /Sources/User.php on line 5372

This is because $data is not set, which also causes a null compare.
  • Loading branch information
jdarwood007 committed Dec 28, 2023
1 parent 95d72cf commit 10d16f7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Sources/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -5370,7 +5370,7 @@ protected static function loadUserData(array $users, int $type = self::LOAD_BY_I
}

// Does the cached data have everything we need?
if (self::$dataset_levels[$data['dataset']] >= self::$dataset_levels[$dataset]) {
if (is_array($data) && !empty(self::$dataset_levels[$data['dataset']]) && !empty(self::$dataset_levels[$dataset]) && self::$dataset_levels[$data['dataset']] >= self::$dataset_levels[$dataset]) {
self::$profiles[$id] = $data;
$loaded_ids[] = $id;
unset($users[$key]);
Expand Down

0 comments on commit 10d16f7

Please # to comment.