Checking for deletion

How do you check if the value of a lookup is deleted? I have a lookup that has another object selected which has since been deleted and it causes a error when retrieving metadata.