From 1beaf6be293abff44a9169ee5b3451edc4c213dd Mon Sep 17 00:00:00 2001 From: Giuseppe Bilotta Date: Sat, 7 Mar 2009 11:03:34 +0100 Subject: lastfm: handle venue not found --- data/rbot/plugins/lastfm.rb | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'data') 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 -- cgit v1.2.3