Modified: trunk/app/models/pack.rb (3760 => 3761)
--- trunk/app/models/pack.rb 2013-11-01 14:10:23 UTC (rev 3760)
+++ trunk/app/models/pack.rb 2013-11-01 14:59:45 UTC (rev 3761)
@@ -715,9 +715,13 @@
end
def component_profile
- entry = contributable_entries.select { |e| e.contributable_type == 'Blob' && e.contributable.component_profile? }.first
- profile = ""
- profile.find_version(entry.contributable_version) if entry.contributable_version
+ entry = contributable_entries.detect { |e| e.contributable_type == 'Blob' && e.contributable.component_profile? }
+ if entry
+ profile = ""
+ profile.find_version(entry.contributable_version) if entry.contributable_version
+ else
+ nil
+ end
end
protected