summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2019-05-10 12:48:43 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2019-05-10 14:12:51 +0900
commita7b68e63c5dd9d366b0ddc17b16650560800f03a (patch)
treee4512d053b9af2bb7e4f9734378d496073160855 /lib
parentc8a891d1aa2fd54172d313441811aef2838b7797 (diff)
Suppress a warning in Psych&YAML with verbose mode
Diffstat (limited to 'lib')
-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: