Sounds like you’re getting a nil response.
Did you check ai embeddings enabled and add your api key to the settings?
ai embeddings enabled