From 4c0f423b956824bcbd542d9d1a3d7a0fbf69932e Mon Sep 17 00:00:00 2001 From: ShahzaibAwan Date: Fri, 23 Dec 2022 20:57:00 +0500 Subject: [PATCH] Add check for handling nil scopes --- lib/travis/api/app/endpoint/authorization.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/travis/api/app/endpoint/authorization.rb b/lib/travis/api/app/endpoint/authorization.rb index a070431837..bd1af572ee 100644 --- a/lib/travis/api/app/endpoint/authorization.rb +++ b/lib/travis/api/app/endpoint/authorization.rb @@ -435,7 +435,7 @@ def generate_token(options) def acceptable?(scopes, lossy = false) Travis::Github::Oauth.wanted_scopes.all? do |scope| - acceptable_scopes_for(scope, lossy).any? { |s| scopes.include? s } + acceptable_scopes_for(scope, lossy).any? { |s| scopes&.include? s } end end