Warning suppression

Checking if variables are null before attempting to use them.