check for nil before accesing the hash object
Merge pull request #7 from TigerTim/master

check for nil before accesing the hash object