Fixes NPE during a save when an index refers to an non-existent field.