aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorGibheer <gibheer@gmail.com>2012-11-15 19:32:14 +0100
committerGibheer <gibheer@gmail.com>2012-11-15 19:32:14 +0100
commit0fd2d00fdbb1e210b3182533bbe0c5cd83c9ea4f (patch)
tree08131399a85e9be632475b07cdb339b2bae7f8c7 /lib
parent022d29d633a6acd25a048f4dd77c09bf347385fb (diff)
check for nil argument and use an empty array
Diffstat (limited to 'lib')
-rw-r--r--lib/zero/request/accept.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/zero/request/accept.rb b/lib/zero/request/accept.rb
index 1cd20ec..9ab1dfc 100644
--- a/lib/zero/request/accept.rb
+++ b/lib/zero/request/accept.rb
@@ -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