Fix a NPE when index metadata was null