Skip to content

Commit ecc9543

Browse files
authored
fix(generator): fix a corner case with a missing ref (googleapis#21133)
1 parent 7b3e4f9 commit ecc9543

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

google-apis-generator/lib/google/apis/generator/annotator.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ def infer_method_name_for_rpc(method, pick_name = true)
112112
parts = method.id.split('.')
113113
parts.shift
114114
verb = ActiveSupport::Inflector.underscore(parts.pop)
115-
match = method.request._ref.match(/(.*)(?i:request)/)
115+
match = method.request._ref&.match(/(.*)(?i:request)/)
116116
return nil if match.nil?
117117
name = ActiveSupport::Inflector.underscore(match[1])
118118
return nil unless name == verb || name.start_with?(verb + '_')

0 commit comments

Comments
 (0)