Permalink
Browse files

Small bit of error handling

  • Loading branch information...
1 parent 7e948bd commit 63474c0fc5b667ef771070cb633fc1f5a5d9650c @suttree committed Nov 9, 2010
Showing with 1 addition and 0 deletions.
  1. +1 −0 traintimes.rb
View
@@ -52,6 +52,7 @@
page_content = page.read()
soup = BeautifulSoup.new(page_content)
result = soup.find('a', :attrs => {'class' => 'status'}).parent
+ result = [] if result.nil?
result.each do |tag|
tag = tag.to_s
if tag.include?(time[0].to_s)

0 comments on commit 63474c0

Please sign in to comment.