From 505810ffd64b32dcad3b66ca2a5c2dcbfe534dec Mon Sep 17 00:00:00 2001 From: Brent Cook Date: Tue, 24 Apr 2018 06:15:05 -0500 Subject: [PATCH] introspect the RHS since it it is not guaranteed to be a Datastore --- lib/msf/core/data_store.rb | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/lib/msf/core/data_store.rb b/lib/msf/core/data_store.rb index c4eb5a2d9e..378ceefb49 100644 --- a/lib/msf/core/data_store.rb +++ b/lib/msf/core/data_store.rb @@ -220,19 +220,15 @@ class DataStore < Hash end def merge!(other) - self.options.merge!(other.options) - self.aliases.merge!(other.aliases) - self.imported.merge!(other.imported) - self.imported_by.merge!(other.imported_by) + super + self.aliases.merge!(other.aliases) if other.respond_to?(:aliases) + self.imported.merge!(other.imported) if other.respond_to?(:imported) + self.imported_by.merge!(other.imported_by) if other.respond_to?(:imported_by) end def merge(other) - ds = copy - ds.options.merge!(other.options) - ds.aliases.merge!(other.aliases) - ds.imported.merge!(other.imported) - ds.imported_by.merge!(other.imported_by) - ds + ds = self.copy + ds.merge!(other) end #