From fa54b6121691dfb5d64a42aa6bf07b4d67aa504f Mon Sep 17 00:00:00 2001 From: Adam Niedzielski Date: Tue, 16 Jul 2024 15:21:16 +0200 Subject: [PATCH] Handle missing links in Webfinger response (#31030) --- app/lib/webfinger.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/lib/webfinger.rb b/app/lib/webfinger.rb index ae8a3b1eae..aeafe19702 100644 --- a/app/lib/webfinger.rb +++ b/app/lib/webfinger.rb @@ -26,7 +26,7 @@ class Webfinger private def links - @links ||= @json['links'].index_by { |link| link['rel'] } + @links ||= @json.fetch('links', []).index_by { |link| link['rel'] } end def validate_response!