Treat a timestamp that can't be parse as if it didn't exist.
authorTom Hughes <tom@compton.nu>
Tue, 26 Jun 2007 23:21:20 +0000 (23:21 +0000)
committerTom Hughes <tom@compton.nu>
Tue, 26 Jun 2007 23:21:20 +0000 (23:21 +0000)
lib/osm.rb

index dea48cc715f84d5b99b353e48caffd88d752ce92..77b07ce3d53bd2b038bdae1eb736916b0e4c0c80 100644 (file)
@@ -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