I find myself having to do this all the time, and when I'm in a hurry I wrap it in a conditional:
if !myhash.blank?
hash.each do |k,v|
do_something
end
end
or:
myhash.map{|k,v| do_something} unless myhash.blank?
There must be something cleaner.