[PATCH] bz831201 fixing handling empty array

Dan Radez dradez at redhat.com
Fri Jul 13 13:01:04 UTC 2012


---
 src/app/models/deployable.rb |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/app/models/deployable.rb b/src/app/models/deployable.rb
index 9c6aff9..e1d80d5 100644
--- a/src/app/models/deployable.rb
+++ b/src/app/models/deployable.rb
@@ -252,7 +252,7 @@ class Deployable < ActiveRecord::Base
     icicle_uuid = image.latest_pushed_or_unpushed_build.target_images.first.icicle rescue nil
     icicle = Aeolus::Image::Warehouse::Icicle.find(icicle_uuid) if icicle_uuid
     agent_v = icicle ? icicle.packages.find_all { |p| p =~ /aeolus-audrey-agent(.*)/ } : ""
-    agent_v = agent_v.first.split('-')[3] if agent_v.present?
+    agent_v = agent_v.present? ? agent_v.first.split('-')[3] : ""
 
     # calculate audrey api version
     audrey_api_v = if agent_v >= "0.5.0"
-- 
1.7.10.4




More information about the aeolus-devel mailing list