summaryrefslogtreecommitdiff
path: root/data/rbot/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'data/rbot/plugins')
-rw-r--r--data/rbot/plugins/fortune.rb10
1 files changed, 8 insertions, 2 deletions
diff --git a/data/rbot/plugins/fortune.rb b/data/rbot/plugins/fortune.rb
index 3e2ffdf7..fc54aebc 100644
--- a/data/rbot/plugins/fortune.rb
+++ b/data/rbot/plugins/fortune.rb
@@ -48,7 +48,10 @@ class FortunePlugin < Plugin
## Pick a fortune
def fortune(m, params)
fortune = find_fortune(m)
- m.reply "fortune executable not found (try setting the 'fortune.path' variable)" unless fortune
+ if not fortune or fortune.empty?
+ m.reply "fortune executable not found (try setting the 'fortune.path' variable)"
+ return
+ end
command = [fortune] + @bot.config['fortune.options']
command << params[:db]
@@ -82,7 +85,10 @@ class FortunePlugin < Plugin
# Print the fortune categories
def categories(m, params)
fortune = find_fortune(m)
- m.reply "fortune executable not found (try setting the 'fortune.path' variable)" unless fortune
+ if not fortune or fortune.empty?
+ m.reply "fortune executable not found (try setting the 'fortune.path' variable)"
+ return
+ end
## list all fortune databases
categories = Utils.safe_exec(fortune, "-f").split(/\n+ */).map{ |f|