From 1336ce4a83269f88634e436bdcf17ab05a5edecb Mon Sep 17 00:00:00 2001
From: Daniel Nemergut <dnemergu@nrao.edu>
Date: Thu, 13 Jun 2024 15:03:11 -0400
Subject: [PATCH] Fixed index error

---
 .../workspaces/system/services/casa_matrix_service.py           | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/shared/workspaces/workspaces/system/services/casa_matrix_service.py b/shared/workspaces/workspaces/system/services/casa_matrix_service.py
index 60c2ca87b..f4c6468c2 100644
--- a/shared/workspaces/workspaces/system/services/casa_matrix_service.py
+++ b/shared/workspaces/workspaces/system/services/casa_matrix_service.py
@@ -253,7 +253,7 @@ class CasaMatrixService(CasaMatrixServiceIF):
 
         # If the requested version is invalid, put the default as first in the list
         # If the default is invalid, the newest version will be first in the list
-        if versions[0]["version"] != version:
+        if versions and versions[0]["version"] != version:
             default = self.get_default_version(capability, telescope)
             if default:
                 for v in versions:
-- 
GitLab