From: Michael Libby Date: 2008-12-17T07:36:40+09:00 Subject: Re: Ruby 1.8.6 - normal behavior ? On Tue, Dec 16, 2008 at 3:39 PM, Aldric Giacomoni <"aldric[remove]"@trevoke.net> wrote: > Tom Link wrote: > Entry is a very big hash and I use those values later - if I don't run those > three lines, I'll get a crash, but if I run those three lines, using those > values is fine even if they don't exist... Oh -- is that because it > -creates- the key-value pair when I look at it ? If the code you posted is really the only relevant code and entry is a Hash, then no. irb(main):003:0> my_big_hash = {} => {} Empty. irb(main):004:0> puts "x" if my_big_hash[:foo].nil? x => nil As expected. irb(main):005:0> my_big_hash => {} Still empty. irb(main):006:0> my_big_hash[:foo].any_method NoMethodError: undefined method `any_method' for nil:NilClass from (irb):6 from :0 Still getting an error. So either your entry object is not a basic Hash, or something else is happening. -Michael -- Michael C. Libby www.mikelibby.com