summaryrefslogtreecommitdiff
path: root/data
diff options
context:
space:
mode:
authorMatthias H <apoc@sixserv.org>2014-02-20 02:37:02 +0100
committerMatthias H <apoc@sixserv.org>2014-02-20 02:37:02 +0100
commit5b95a8d999c35aa36cf061036de3400231bcd269 (patch)
treecd2a64677d16f3721b641544b518f0fa1ffb952b /data
parentef140882117ff36557d43d7be1e55a6850c60f94 (diff)
[plugin] fortune: fixed bin/not-found
Diffstat (limited to 'data')
-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|