From bd045414cfa2f2332ae766ae80c9e7c225bfa971 Mon Sep 17 00:00:00 2001 From: Giuseppe Bilotta Date: Thu, 18 Nov 2010 16:08:19 +0100 Subject: [PATCH] rss plugin: don't fail when feed.last_success is nil The first_run check comparing the time delta from last success failed when feed.last_success was nil. Prevent this from happening by checking if we are on the first run before the rest of the checks. --- data/rbot/plugins/rss.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/rbot/plugins/rss.rb b/data/rbot/plugins/rss.rb index ea8b096c..3b09930a 100644 --- a/data/rbot/plugins/rss.rb +++ b/data/rbot/plugins/rss.rb @@ -928,7 +928,7 @@ class RSSFeedsPlugin < Plugin debug "fetching #{feed}" first_run = !feed.last_success - if (@bot.config['rss.announce_timeout'] > 0 && + if (!first_run && @bot.config['rss.announce_timeout'] > 0 && (Time.now - feed.last_success > @bot.config['rss.announce_timeout'])) debug "#{feed} wasn't polled for too long, supressing output" first_run = true -- 2.39.2