Skip to content

Commit

Permalink
test if hashed_obj.respond_to?(:collection) before calling it
Browse files Browse the repository at this point in the history
  • Loading branch information
syphax-bouazzouni committed Nov 17, 2022
1 parent 39364c0 commit ba7a7f8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/ontologies_linked_data/serializers/json.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def self.type(current_cls, hashed_obj)
proc = hashed_obj
end

collection = hashed_obj.collection
collection = hashed_obj.respond_to?(:collection) ? hashed_obj.collection : nil
if collection
proc.type_uri(collection).to_s
else
Expand Down

0 comments on commit ba7a7f8

Please sign in to comment.