Check key existence before access it.