NoMethodError: undefined method `name' for nil:NilClass
Sentry error: https://new-sentry.gitlab.net/organizations/gitlab/issues/841713
NoMethodError: undefined method `name' for nil:NilClass
refs.select { |ref| ref.is_a?(String) ? matches?(ref) : matches?(ref.name) }
^^^^^
from app/models/ref_matcher.rb:11:in `block in matching'
from app/models/ref_matcher.rb:11:in `select'
from app/models/ref_matcher.rb:11:in `matching'
from ee/app/services/security/security_orchestration_policies/policy_branches_service.rb:91:in `block in all_branches_matched_by'
from ee/app/services/security/security_orchestration_policies/policy_branches_service.rb:90:in `each'
from ee/app/services/security/security_orchestration_policies/policy_branches_service.rb:90:in `flat_map'
from ee/app/services/security/security_orchestration_policies/policy_branches_service.rb:90:in `all_branches_matched_by'
from ee/app/services/security/security_orchestration_policies/policy_branches_service.rb:83:in `matched_protected_branches'
from ee/app/services/security/security_orchestration_policies/policy_branches_service.rb:70:in `match_branch_types'
from ee/app/services/security/security_orchestration_policies/policy_branches_service.rb:61:in `match_rule'
from ee/app/services/security/security_orchestration_policies/policy_branches_service.rb:56:in `block in matched_branches'
from ee/app/services/security/security_orchestration_policies/policy_branches_service.rb:55:in `each'
from ee/app/services/security/security_orchestration_policies/policy_branches_service.rb:55:in `reduce'
from ee/app/services/security/security_orchestration_policies/policy_branches_service.rb:55:in `matched_branches'
from ee/app/services/security/security_orchestration_policies/policy_branches_service.rb:25:in `included_branches'
from ee/app/services/security/security_orchestration_policies/policy_branches_service.rb:19:in `execute'
from ee/app/services/security/security_orchestration_policies/policy_branches_service.rb:13:in `scan_result_branches'
from ee/app/services/security/security_orchestration_policies/protected_branches_push_service.rb:7:in `execute'
from ee/app/services/security/security_orchestration_policies/protected_branches_unprotect_service.rb:10:in `execute'
from ee/app/controllers/ee/projects/settings/repository_controller.rb:60:in `fetch_branches_protected_from_push'
from ee/app/controllers/ee/projects/settings/repository_controller.rb:67:in `define_protected_refs'
from app/controllers/projects/settings/repository_controller.rb:88:in `define_variables'
from app/controllers/projects/settings/repository_controller.rb:79:in `render_show'