If a variable can be null, check it before using it.