Check whether vars are non-nil before using them.