0
0
Fork 0

Fix 500 error in GET /api/v2_alpha/notifications when there are no notifications to return (#31746)

This commit is contained in:
Claire 2024-09-04 14:54:15 +02:00 committed by GitHub
parent ee55d20fd5
commit 1fcffa573c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 15 additions and 0 deletions

View file

@ -77,6 +77,8 @@ class Api::V2Alpha::NotificationsController < Api::BaseController
end
def load_grouped_notifications
return [] if @notifications.empty?
MastodonOTELTracer.in_span('Api::V2Alpha::NotificationsController#load_grouped_notifications') do
NotificationGroup.from_notifications(@notifications, pagination_range: (@notifications.last.id)..(@notifications.first.id), grouped_types: params[:grouped_types])
end