From fb60bc77ecc3097485592b37a7832432d79b3040 Mon Sep 17 00:00:00 2001 From: Shawn McGough Date: Mon, 25 Mar 2024 17:38:50 -0400 Subject: [PATCH] fix bug that allowed for missing collection for on-prem tfs --- app/lib/connection.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/lib/connection.ts b/app/lib/connection.ts index 712b288f..7a58cddc 100644 --- a/app/lib/connection.ts +++ b/app/lib/connection.ts @@ -26,8 +26,8 @@ export class TfsConnection { throw new Error( "Invalid service url - path is too long. A service URL should include the account/application URL and the collection, e.g. https://fabrikam.visualstudio.com/DefaultCollection or http://tfs-server:8080/tfs/DefaultCollection", ); - } else if (splitPath.length === 0) { - throw new Error("Expected URL path."); + } else if (splitPath.length === 0 || (splitPath[0] === "tfs" && splitPath.length === 1)) { + throw new Error("Expected URL path (collection name missing)."); } if (splitPath[0].trim() !== "" || (splitPath[0] === "tfs" && splitPath[1].trim() !== "")) {