0
0
Fork 0

check for nil argument and use an empty array

This commit is contained in:
Gibheer 2012-11-15 19:32:14 +01:00
parent 022d29d633
commit 0fd2d00fdb
1 changed files with 5 additions and 1 deletions

View File

@ -17,7 +17,11 @@ module Zero
# create a new accept object
def initialize(accept_string)
@types = parse_media_types(accept_string)
if accept_string.nil?
@types = []
else
@types = parse_media_types(accept_string)
end
end
# return the preferred type