Project

General

Profile

« Previous | Next » 

Revision 76228fb7

Added by Marc Dequènes about 15 years ago

  • ID 76228fb70bc9717cdbb4de50bbaa0f0da9cc9b5a

[fix] check for needed aspect for an object was subject to crash

View differences:

lib/ldap_shadows/elements/object.rb
object_rel = {}
object_rel.merge!(self.parameters[:relations]) if self.parameters.include?(:relations)
if self.parameters[:presentation].has_key?(:allowed_aspects)
self.parameters[:presentation][:allowed_aspects].each do |aspect|
aspect_data = self.shadow.get_aspect(aspect).parameters
if aspect_data.nil?
raise PreProcessingError, _("Aspect '%s' is missing for object '%s'") % [aspect, self.handle]
self.parameters[:presentation][:allowed_aspects].each do |aspect_name|
aspect = self.shadow.get_aspect(aspect_name)
if aspect.nil?
raise PreProcessingError, _("Aspect '%s' is missing for object '%s'") % [aspect_name, self.handle]
end
aspect_data = aspect.parameters
object_rel.merge!(aspect_data[:relations]) if aspect_data.has_key?(:relations) and aspect_data[:relations]
end
end

Also available in: Unified diff