Skip to content
Browse files

Gracefully handle missing song id

  • Loading branch information...
1 parent 1deda21 commit fc00bde3fbade5ff985cd6abfacc0e7ff0a1b69b @dcramer committed Apr 23, 2012
Showing with 2 additions and 1 deletion.
  1. +2 −1 app/api/system.rb
View
3 app/api/system.rb
@@ -5,7 +5,8 @@ class App < Sinatra::Base
get "/images/art/:id.png" do
content_type 'image/png'
- if art = Song.find(params[:id]).album_art_data
+ song = Song.find(params[:id])
+ if song and art = song.album_art_data
response['Cache-Control'] = 'public, max-age=2500000'
etag params[:id]
art

0 comments on commit fc00bde

Please sign in to comment.
Something went wrong with that request. Please try again.