Fix 500 error in GET /api/v2_alpha/notifications when there are no notifications to return (#31746)
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user