Permalink
Browse files

Fixed nil bug in Url.base

  • Loading branch information...
1 parent 272229a commit e147ee13cda2d086297ed9cf2cba28480d1a59dc Andreas Zecher committed Aug 31, 2011
Showing with 4 additions and 2 deletions.
  1. +4 −2 lib/raev/url.rb
View
@@ -8,8 +8,10 @@ def initialize(url)
@url = url
end
- def base
- @url.split('/')[2].gsub('www.', '')
+ def base
+ base_url = @url.split('/')[2]
+ base_url = base_url.gsub('www.', '') unless base_url.nil?
+ base_url
end
def clean

0 comments on commit e147ee1

Please sign in to comment.