From a889ba94b72d19f17bb66b57ebfa29ad00fbb4b5 Mon Sep 17 00:00:00 2001 From: Gregg Kellogg Date: Tue, 31 Oct 2023 13:06:04 -0700 Subject: [PATCH] Add check to see if subject implements `supports?` before using it, which isn't the case for a Writer. --- lib/rdf/mixin/writable.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/rdf/mixin/writable.rb b/lib/rdf/mixin/writable.rb index 987958e2..5fe07b86 100644 --- a/lib/rdf/mixin/writable.rb +++ b/lib/rdf/mixin/writable.rb @@ -130,7 +130,7 @@ def insert_statements(statements) if statement.embedded? && respond_to?(:supports?) && !supports?(:quoted_triples) raise ArgumentError, "Writable does not support quoted triples" end - if statement.object && statement.object.literal? && statement.object.direction? && !supports?(:base_direction) + if statement.object && statement.object.literal? && statement.object.direction? && respond_to?(:supports?) && !supports?(:base_direction) raise ArgumentError, "Writable does not support directional languaged-tagged strings" end insert_statement(statement)