diff --git a/shared/workspaces/workspaces/system/services/casa_matrix_service.py b/shared/workspaces/workspaces/system/services/casa_matrix_service.py
index 60c2ca87b5e99ec3afe0519d084a94b23d07acf0..f4c6468c206ec2ea471b388e1fdbfee9e03d9f40 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: