Skip to content

Commit

Permalink
Merge pull request #11111 from nanaya/preset-id-negative
Browse files Browse the repository at this point in the history
Fix cover error on user model placeholder
  • Loading branch information
peppy authored Mar 22, 2024
2 parents fcde896 + d6c49a1 commit 0641150
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/Libraries/User/Cover.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public function customUrl(): ?string

public function defaultPresetId(): string
{
$id = $this->user->getKey() ?? 0;
$id = max(0, $this->user->getKey() ?? 0);

return static::AVAILABLE_PRESET_IDS[$id % count(static::AVAILABLE_PRESET_IDS)];
}
Expand Down

0 comments on commit 0641150

Please sign in to comment.