Skip to content

Commit 0e3c0d0

Browse files
committed
Fix a replace called in YAML decoding
1 parent 50b8a19 commit 0e3c0d0

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/attributed_string/string_ops.rb

+2-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,8 @@ def prepend(other)
7272
# modifies the string or returns a modified string
7373
def replace(other)
7474
super
75-
@store = other.instance_variable_get(:@store).map { |obj| obj.dup }
75+
other_store = other.instance_variable_get(:@store) || []
76+
@store = other_store.map { |obj| obj.dup }
7677
end
7778

7879
def +(other)

0 commit comments

Comments
 (0)