From: Tom Hughes Date: Tue, 26 Jun 2007 23:21:20 +0000 (+0000) Subject: Treat a timestamp that can't be parse as if it didn't exist. X-Git-Tag: live~8320 X-Git-Url: https://git.openstreetmap.org/rails.git/commitdiff_plain/dcac9dfeca26b38d3a5eb16a2b0276b0e7619e22?hp=d77fb110fbca4fc7ec796b1ce5f5249b40df561f Treat a timestamp that can't be parse as if it didn't exist. --- diff --git a/lib/osm.rb b/lib/osm.rb index dea48cc71..77b07ce3d 100644 --- a/lib/osm.rb +++ b/lib/osm.rb @@ -101,8 +101,11 @@ module OSM parser.listen( :characters, %w{ time } ) do |text| if text && text != '' - date = DateTime.parse(text) - gotdate = true + begin + date = DateTime.parse(text) + gotdate = true + rescue + end end end