diff --git a/.changeset/long-mirrors-battle.md b/.changeset/long-mirrors-battle.md
new file mode 100644
index 0000000000000000000000000000000000000000..20e6370b17aee2bc4b80729dbd3fd28c1a916505
--- /dev/null
+++ b/.changeset/long-mirrors-battle.md
@@ -0,0 +1,5 @@
+---
+"llamaindex": patch
+---
+
+fix: throw error when no pipelines exist for the retriever
diff --git a/packages/core/src/cloud/LlamaCloudRetriever.ts b/packages/core/src/cloud/LlamaCloudRetriever.ts
index 05f94f3abecb9e149e91572eec679ed9f22cbd31..dc4147852e6516ba702418c487a9e33a967fb4b7 100644
--- a/packages/core/src/cloud/LlamaCloudRetriever.ts
+++ b/packages/core/src/cloud/LlamaCloudRetriever.ts
@@ -65,7 +65,7 @@ export class LlamaCloudRetriever implements BaseRetriever {
       projectName: this.projectName,
       pipelineName: this.pipelineName,
     });
-    if (pipelines.length !== 1 && !pipelines[0].id) {
+    if (pipelines.length !== 1 && !pipelines[0]?.id) {
       throw new Error(
         `No pipeline found with name ${this.pipelineName} in project ${this.projectName}`,
       );