]> git.cworth.org Git - sup/commitdiff
don't crash when people.txt is corrupted
authorWilliam Morgan <wmorgan-sup@masanjin.net>
Mon, 28 Jan 2008 20:15:38 +0000 (12:15 -0800)
committerWilliam Morgan <wmorgan-sup@masanjin.net>
Mon, 28 Jan 2008 20:15:38 +0000 (12:15 -0800)
This was a debug check, but if Sup crashes when writing out people.txt,
this will prevent it from ever starting again!

lib/sup/person.rb

index 5bd15a82856095f7582f7f7c109218931d23d514..1c721e4f8728ab36874e47bb145356dec1589a7b 100644 (file)
@@ -9,7 +9,7 @@ class PersonManager
 
     ## read in stored people
     IO.readlines(fn).map do |l|
-      l =~ /^(.*)?:\s+(\d+)\s+(.*)$/ or raise "can't parse: #{l}"
+      l =~ /^(.*)?:\s+(\d+)\s+(.*)$/ or next
       email, time, name = $1, $2, $3
       @@people[email] = Person.new name, email, time, false
     end if File.exists? fn