Guard the getter expressions against NPEs.