aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ostruct.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/ostruct.rb')
-rw-r--r--lib/ostruct.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/ostruct.rb b/lib/ostruct.rb
index c3b0546d5f..7b232bf5a9 100644
--- a/lib/ostruct.rb
+++ b/lib/ostruct.rb
@@ -206,7 +206,7 @@ class OpenStruct
def respond_to_missing?(mid, include_private = false) # :nodoc:
mname = mid.to_s.chomp("=").to_sym
- @table&.key?(mname) || super
+ defined?(@table) && @table.key?(mname) || super
end
def method_missing(mid, *args) # :nodoc: