Commit a1e2b31b58e13045f501f4f9c323506b31a2feda

Authored by Marcos Pereira
1 parent 8880af6d

Fixes error in software_info get method when license_info is nil

Signed-off-by: Athos Ribeiro <athoscribeiro@gmail.com>
Signed-off-by: Macartur Sousa <macartur.sc@gmail.com>
Signed-off-by: Marcos Ronaldo <marcos.rpj2@gmail.com>
src/noosfero-spb/software_communities/lib/software_info.rb
@@ -139,7 +139,7 @@ class SoftwareInfo &lt; ActiveRecord::Base @@ -139,7 +139,7 @@ class SoftwareInfo &lt; ActiveRecord::Base
139 license = LicenseInfo.find_by_id self.license_info_id 139 license = LicenseInfo.find_by_id self.license_info_id
140 license_another = LicenseInfo.find_by_version("Another") 140 license_another = LicenseInfo.find_by_version("Another")
141 141
142 - if license_another && license.id == license_another.id 142 + if license_another && license && license.id == license_another.id
143 LicenseInfo.new( 143 LicenseInfo.new(
144 :version => self.another_license_version, 144 :version => self.another_license_version,
145 :link => self.another_license_link 145 :link => self.another_license_link