diff options
author | Giuseppe Bilotta <giuseppe.bilotta@gmail.com> | 2009-01-31 11:49:18 +0100 |
---|---|---|
committer | Giuseppe Bilotta <giuseppe.bilotta@gmail.com> | 2009-01-31 11:49:18 +0100 |
commit | 75ca888d6b16bc3cc417e168c7544a8da8bd6aab (patch) | |
tree | 0b3f0140df4f403951f2d817290c0ca3c72b61f7 | |
parent | 2f6286930d5a8f246c83c4c83dd60ba5f1119f8e (diff) |
rss plugin: fix return/error handling in parseRss
Commit 36f1f28e668919dfab75c8fc4d1020abad351bd1 borked error handling as
it assumed that a false or nil rss implied a nonempty errors, and it
failed to return early.
Fix by removing the early check for a missing rss and wrapping the
report_problem (and the previously missing 'return nil') in the check
for a nonempty errors array.
-rw-r--r-- | data/rbot/plugins/rss.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/data/rbot/plugins/rss.rb b/data/rbot/plugins/rss.rb index 981eb4f8..f9399816 100644 --- a/data/rbot/plugins/rss.rb +++ b/data/rbot/plugins/rss.rb @@ -1157,9 +1157,10 @@ class RSSFeedsPlugin < Plugin errors << [parser, e, "processing error occured, sorry =("] end end - debug errors unless errors.empty? - if !rss + unless errors.empty? + debug errors self.send(:report_problem, errors.last[2], errors.last[1], m) + return nil end items = [] if rss.nil? |