We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents eecc0dc + 6f70ab3 commit a8f1f16Copy full SHA for a8f1f16
Sources/Board.php
@@ -935,7 +935,15 @@ public static function unload(int $id): void
935
}
936
937
// Can we unload the category too?
938
- if ($id > 0 && self::$loaded[$id]->cat?->id > 0 && array_filter(self::$loaded, fn($b) => $b->id !== $id && $b->cat?->id === self::$loaded[$id]->cat->id) === []) {
+ if (
939
+ $id > 0
940
+ && isset(self::$loaded[$id]->cat)
941
+ && self::$loaded[$id]->cat->id > 0
942
+ && [] === array_filter(
943
+ self::$loaded,
944
+ fn($b) => $b->id !== $id && $b->cat?->id === self::$loaded[$id]->cat->id,
945
+ )
946
+ ) {
947
Category::unload(self::$loaded[$id]->cat->id);
948
949
0 commit comments