Prevent accesing fields on nulls