From 75212d20e04b2a6dc3d0877a772792d24c8598ee Mon Sep 17 00:00:00 2001 From: "Michael J. Cohen" Date: Sat, 31 Dec 2011 02:04:04 -0500 Subject: [PATCH] Check for None when requesting an artist page --- headphones/webserve.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/headphones/webserve.py b/headphones/webserve.py index e87f5456..812d8ceb 100644 --- a/headphones/webserve.py +++ b/headphones/webserve.py @@ -44,6 +44,8 @@ class WebInterface(object): myDB = db.DBConnection() artist = myDB.action('SELECT * FROM artists WHERE ArtistID=?', [ArtistID]).fetchone() albums = myDB.select('SELECT * from albums WHERE ArtistID=? order by ReleaseDate DESC', [ArtistID]) + if artist is None: + raise cherrypy.HTTPRedirect("home") return serve_template(templatename="artist.html", title=artist['ArtistName'], artist=artist, albums=albums) artistPage.exposed = True