Fixing nil time bug.
parent
371a3fa0b9
commit
48053d44c4
|
@ -48,8 +48,10 @@ module GPX
|
|||
unless segment_element.is_a?(Text)
|
||||
XPath.each(segment_element, "child::trkpt") do |trkpt|
|
||||
pt = TrackPoint.new(:element => trkpt, :segment => self)
|
||||
unless pt.time.nil?
|
||||
@earliest_point = pt if(@earliest_point.nil? or pt.time < @earliest_point.time)
|
||||
@latest_point = pt if(@latest_point.nil? or pt.time > @latest_point.time)
|
||||
end
|
||||
unless pt.elevation.nil?
|
||||
@lowest_point = pt if(@lowest_point.nil? or pt.elevation < @lowest_point.elevation)
|
||||
@highest_point = pt if(@highest_point.nil? or pt.elevation > @highest_point.elevation)
|
||||
|
|
Loading…
Reference in New Issue