myexperiment-hackers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[myexperiment-hackers] [3761] trunk/app/models/pack.rb: Fixed issue that


From: noreply
Subject: [myexperiment-hackers] [3761] trunk/app/models/pack.rb: Fixed issue that arises when component family doesnt have a valid profile
Date: Fri, 1 Nov 2013 14:59:45 +0000 (UTC)

Revision
3761
Author
fbacall
Date
2013-11-01 14:59:45 +0000 (Fri, 01 Nov 2013)

Log Message

Fixed issue that arises when component family doesnt have a valid profile

Modified Paths

Diff

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

reply via email to

[Prev in Thread] Current Thread [Next in Thread]