From 75ca888d6b16bc3cc417e168c7544a8da8bd6aab Mon Sep 17 00:00:00 2001 From: Giuseppe Bilotta Date: Sat, 31 Jan 2009 11:49:18 +0100 Subject: 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. --- data/rbot/plugins/rss.rb | 5 +++-- 1 file 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? -- cgit v1.2.3