guard against nil and false ranges

git-svn-id: file:///home/svn/framework3/trunk@13446 4d416f70-5f16-0410-b530-b9f4589650da
unstable
James Lee 2011-07-31 15:48:29 +00:00
parent 730e41263f
commit f5862e87d0
1 changed files with 3 additions and 0 deletions

View File

@ -162,6 +162,9 @@ class RangeWalker
# given RangeWalker
#
def include_range?(range_walker)
return false if ((not @ranges) or @ranges.empty?)
return false if not range_walker.ranges
range_walker.ranges.all? do |start, stop|
ranges.any? do |self_start, self_stop|
r = (self_start..self_stop)