Permalink
Browse files

Fix nil coercion bug on playlists

  • Loading branch information...
1 parent 25e8683 commit de9a723421a986967cd61121b9538d4670a551d5 @sudara committed Oct 24, 2011
Showing with 3 additions and 3 deletions.
  1. +3 −3 app/models/playlist.rb
View
@@ -64,9 +64,9 @@ def empty?
end
def play_time
- total_track_length = tracks.inject(0){ |total,
- track| total += track.asset_length
- }
+ total_track_length = tracks.inject(0) do |total, track|
+ total += track.asset_length || 0
+ end
Asset.formatted_time(total_track_length)
end

0 comments on commit de9a723

Please sign in to comment.