diff options
| author | Laerti Papa <laerti.papa@xing.com> | 2018-09-30 14:00:12 +0200 |
|---|---|---|
| committer | Laerti Papa <laerti.papa@xing.com> | 2018-10-02 17:06:46 +0200 |
| commit | 209f8afd84b987e33c53dce1cb7e138461054a41 (patch) | |
| tree | 5947ee0a52f18c9d9bda8676bfc96237943b5b91 /lib | |
| parent | 506c385ccc034eaf1e3420ce9940749b3acdc42b (diff) | |
| download | hashie-209f8afd84b987e33c53dce1cb7e138461054a41.tar.gz | |
Do not call any reader attribute in Mash#update if key does not exist
Refs: https://github.com/intridea/hashie/issues/464
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/hashie/mash.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/hashie/mash.rb b/lib/hashie/mash.rb index 02ccc3f..37a903f 100644 --- a/lib/hashie/mash.rb +++ b/lib/hashie/mash.rb @@ -214,7 +214,7 @@ module Hashie def deep_update(other_hash, &blk) other_hash.each_pair do |k, v| key = convert_key(k) - if regular_reader(key).is_a?(Mash) && v.is_a?(::Hash) + if key?(key) && regular_reader(key).is_a?(Mash) && v.is_a?(::Hash) custom_reader(key).deep_update(v, &blk) else value = convert_value(v, true) |
