Skip to content

Commit 1930c18

Browse files
authored
Add SafeOperator before match
1 parent b37025c commit 1930c18

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/grape/middleware/versioner/parse_media_type_patch.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ class << self
88
# Corrected version of https://github.com/mjackson/rack-accept/blob/master/lib/rack/accept/header.rb#L40-L44
99
def parse_media_type(media_type)
1010
# see http://tools.ietf.org/html/rfc6838#section-4.2 for allowed characters in media type names
11-
m = media_type.match(ALLOWED_CHARACTERS)
11+
m = media_type&.match(ALLOWED_CHARACTERS)
1212
m ? [m[1], m[2], m[3] || ''] : []
1313
end
1414
end

0 commit comments

Comments
 (0)