added precheck for getting fieldDefinition by index.