lib/fiona7/widget_resolver.rb in infopark_fiona7-0.71.1.0 vs lib/fiona7/widget_resolver.rb in infopark_fiona7-0.71.1.1
- old
+ new
@@ -22,16 +22,23 @@
]
self.id_map = widget_id_to_object_id_map.dup
self.path_map = Hash[
widget_id_to_object_id_map.map {|widget_id, obj_id|
- [widget_id, object_id_to_widget_instance_map[obj_id].path]
- }
+ path = object_id_to_widget_instance_map[obj_id].try(:path)
+ next unless path
+ [widget_id, object_id_to_widget_instance_map[obj_id].try(:path)]
+ }.compact
]
self.instance_map = Hash[
widget_id_to_object_id_map.map {|widget_id, obj_id|
- [widget_id, object_id_to_widget_instance_map[obj_id]]
- }
+ object = object_id_to_widget_instance_map[obj_id]
+ if !object
+ Rails.logger.error("Unable to find widget with id #{widget_id} (obj_id = #{obj_Id})")
+ next
+ end
+ [widget_id, object]
+ }.compact
]
end
end
end