From a491d70b0eb170ff52a9a1a3be003a2908074700 Mon Sep 17 00:00:00 2001 From: Shish Date: Thu, 21 Dec 2023 15:26:30 +0000 Subject: [PATCH] [ratings] don't crash if rating isn't set yet --- ext/rating/main.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ext/rating/main.php b/ext/rating/main.php index 9ad774152..d02f5e27b 100644 --- a/ext/rating/main.php +++ b/ext/rating/main.php @@ -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)