Check properties are not null before dereferencing them