From 5d266e01a6197ca1a1f63110c9fc77e3ee4079a9 Mon Sep 17 00:00:00 2001
From: TheAimMan <147098375+TheAimMan@users.noreply.github.com>
Date: Mon, 23 Oct 2023 05:19:49 -0400
Subject: [PATCH] Fix rm on .cct files (#880)

---
 src/Server/BaseServer.ts | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/Server/BaseServer.ts b/src/Server/BaseServer.ts
index d2e046cbe..884d2d7d2 100644
--- a/src/Server/BaseServer.ts
+++ b/src/Server/BaseServer.ts
@@ -202,7 +202,7 @@ export abstract class BaseServer implements IServer {
       return { res: true };
     }
     if (path.endsWith(".cct")) {
-      const contractIndex = this.contracts.findIndex((program) => program);
+      const contractIndex = this.contracts.findIndex((contracts) => contracts.fn === path);
       if (contractIndex === -1) return { res: false, msg: `Contract file ${path} does not exist` };
       this.contracts.splice(contractIndex, 1);
       return { res: true };