Check for nulls before operating on them