Skip to content

Commit

Permalink
Don't try to use parsed_url if it is nil.
Browse files Browse the repository at this point in the history
Fixing issue #121 . I wasn't
able to reproduce the issue so this fix is a bit of a hack rather than
fixing the route cause that resulted in parsed_url being nil.
  • Loading branch information
digininja committed Jul 30, 2024
1 parent e2858c1 commit 869f68f
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions cewl.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
# Licence:: CC-BY-SA 2.0 or GPL-3+
#

VERSION = "6.2 (Fixes)"
VERSION = "6.2.1 (More Fixes)"

puts "CeWL #{VERSION} Robin Wood ([email protected]) (https://digi.ninja/)\n"

Expand Down Expand Up @@ -169,8 +169,10 @@ def start! #:nodoc:

y = []
x.select do |a_url, parsed_url|
if (parsed_url.scheme == "mailto" or parsed_url.scheme == "http" or parsed_url.scheme == "https") then
y << [a_url, parsed_url] if allowable_url?(a_url, parsed_url)
if (not parsed_url.nil?) then
if (parsed_url.scheme == "mailto" or parsed_url.scheme == "http" or parsed_url.scheme == "https") then
y << [a_url, parsed_url] if allowable_url?(a_url, parsed_url)
end
end
end

Expand Down

0 comments on commit 869f68f

Please sign in to comment.