Skip to content

Commit

Permalink
[ratings] don't crash if rating isn't set yet
Browse files Browse the repository at this point in the history
  • Loading branch information
shish committed Dec 21, 2023
1 parent 4decd03 commit a491d70
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ext/rating/main.php
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,9 @@ public function onImageInfoSet(ImageInfoSetEvent $event)

public function onParseLinkTemplate(ParseLinkTemplateEvent $event)
{
$event->replace('$rating', $this->rating_to_human($event->image->rating));
if(!is_null($event->image->rating)) {
$event->replace('$rating', $this->rating_to_human($event->image->rating));
}
}

public function onHelpPageBuilding(HelpPageBuildingEvent $event)
Expand Down

0 comments on commit a491d70

Please sign in to comment.