index.getIdentifier() may return null here - we should check for that and fail fast.