How to catch an "undefined method `[]' for nil:NilClass" error?
===

I get an nested array from facebook via omniauth and wanna check if it's empty?/nil?/exists?
the depending line looks like:

     unless omniauth['extra']['raw_info']['location']['name'].nil?

This should check if this part of the array is empty or exists.

But always this error was thrown:

    undefined method `[]' for nil:NilClass

Do I check arrays wrong?

I tried it with "has_key" "nil?" "empty?" "exists?" "blank?"

But no one of these works!

Please help me, many thanks in advance!