Fix Gallery frontend controller crash when albun.tag_ids is empty

This commit is contained in:
Manson Wang 2013-11-15 09:53:24 +08:00
parent 827a5e52e7
commit 7519533107
1 changed files with 2 additions and 1 deletions

View File

@ -46,7 +46,8 @@ class Panel::Gallery::FrontEnd::AlbumsController < OrbitWidgetController
@album = GalleryAlbum.find(@albumid)
@images = @album.gallery_images.all
tags = @album.tag_ids
@tagnames = Tag.find(tags.tagged_ids).map{|t| t.name}
@tagnames = [] if tags.blank?
@tagnames = Tag.find(tags.tagged_ids).map{|t| t.name} if !tags.blank?
@back_link = panel_gallery_front_end_album_path(@albumid)
end
end