From bfc82dbb93c3f34ed12b3d1cd568eeb492766fba Mon Sep 17 00:00:00 2001 From: Peter Boling Date: Mon, 1 Nov 2021 05:06:09 +0700 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Closes=20#165:=20NoMethodError?= =?UTF-8?q?=20on=20nil=20request?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Peter Boling --- lib/oauth/errors/unauthorized.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/oauth/errors/unauthorized.rb b/lib/oauth/errors/unauthorized.rb index e304d6b4..2ca30f6d 100644 --- a/lib/oauth/errors/unauthorized.rb +++ b/lib/oauth/errors/unauthorized.rb @@ -6,7 +6,9 @@ def initialize(request = nil) end def to_s - [request.code, request.message] * " " + return "401 Unauthorized" if request.nil? + + "#{request.code} #{request.message}" end end end