From a54c64034ddf562bba7b0ebc30cf483ec92502d2 Mon Sep 17 00:00:00 2001 From: Jeena Date: Sun, 24 Apr 2016 01:28:27 +0200 Subject: [PATCH] Don't crash if it's not possible to attach to property Normally one can attach to properties, but if it is of a type URL then it crashes hard. This check just drops everything which can't be attached by `<<`. --- lib/microformats2/format.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/microformats2/format.rb b/lib/microformats2/format.rb index 7d09deb..caaeca1 100644 --- a/lib/microformats2/format.rb +++ b/lib/microformats2/format.rb @@ -102,7 +102,7 @@ module Microformats2 send("#{mn}=", value) end if current = send(mn.pluralize) - current << value + current << value if current.respond_to? :<< else send("#{mn.pluralize}=", [value]) end