summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGiuseppe Bilotta <giuseppe.bilotta@gmail.com>2009-03-07 11:03:34 +0100
committerGiuseppe Bilotta <giuseppe.bilotta@gmail.com>2009-03-07 11:03:34 +0100
commit1beaf6be293abff44a9169ee5b3451edc4c213dd (patch)
treea723cfd69f37d9e4ee102175cf4f10c736e20c75
parent00f2fa9d625b19d6c8b33c62ea41460924e43634 (diff)
lastfm: handle venue not found
-rw-r--r--data/rbot/plugins/lastfm.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/data/rbot/plugins/lastfm.rb b/data/rbot/plugins/lastfm.rb
index 1b7203bf..11154069 100644
--- a/data/rbot/plugins/lastfm.rb
+++ b/data/rbot/plugins/lastfm.rb
@@ -184,6 +184,10 @@ class LastFmPlugin < Plugin
emptymsg = _("no events found in %{location}") % {:location => location.to_s}
elsif venue
venues = search_venue_by(:name => venue.to_s, :limit => 1)
+ if venues.empty?
+ m.reply _("no venue found matching %{venue}") % {:venue => venue.to_s}
+ return
+ end
venue = venues.first
uri = "#{APIURL}method=venue.getevents&venue=#{venue.id}"
elsif artist