Skip to content
This repository has been archived by the owner on May 12, 2020. It is now read-only.

Commit

Permalink
Test for nil as well as empty strings
Browse files Browse the repository at this point in the history
  • Loading branch information
alexcrichton committed Sep 18, 2011
1 parent c0ddae6 commit da6424f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/radio/stream.rb
Expand Up @@ -70,16 +70,16 @@ def next_song &block

string = title
string << ' ('
string << artist unless artist == ''
if album != ''
string << artist unless artist.blank?
if album.present?
string << ' - '
string << album
end
string << ')'

m.add 'song', string
m.add 'artist', artist unless artist == ''
m.add 'album', album unless album == ''
m.add 'artist', artist unless artist.blank?
m.add 'album', album unless album.blank?
m.add 'genre', 'awesome'

block.call song, m, queue_item
Expand Down

0 comments on commit da6424f

Please sign in to comment.