Permalink
Browse files

Guard against nil when inspecting statement.

  • Loading branch information...
1 parent ecd078e commit a9ed3bbbb98b0bb455af9d3fd26c072d98349c76 @gkellogg gkellogg committed Mar 23, 2013
Showing with 3 additions and 1 deletion.
  1. +3 −1 lib/rdf/model/statement.rb
@@ -260,7 +260,9 @@ def to_hash(subject_key = :subject, predicate_key = :predicate, object_key = :ob
#
# @return [String]
def to_s
- (context ? to_quad : to_triple).map(&:to_base).join(" ") + " ."
+ (context ? to_quad : to_triple).map do |term|
+ term.respond_to?(:to_base) ? term.to_base : term.inspect
+ end.join(" ") + " ."
end
##

0 comments on commit a9ed3bb

Please sign in to comment.