diff --git a/tasks/install.yml b/tasks/install.yml
index 5e21be71d3778113c4514ae756b0d057539a46a2..bee0ee49c6216ed5ed4415d8c59fe1fc1d17902f 100644
--- a/tasks/install.yml
+++ b/tasks/install.yml
@@ -66,7 +66,7 @@
 - name: set fact for conda executable
   set_fact:
     conda_current_conda_version: "{{ ((conda_version_check.stdout | from_json) | selectattr('name','equalto','conda') | list)[0].version }}"
-    conda_current_mamba_version: "{{ ((conda_version_check.stdout | from_json) | selectattr('name','equalto','mamba') | list)[0].version if ((conda_version_check.stdout | from_json) | selectattr('name','equalto','mamba') | list) }}"
+    conda_current_mamba_version: "{{ ((conda_version_check.stdout | from_json) | selectattr('name','equalto','mamba') | list)[0].version if ((conda_version_check.stdout | from_json) | selectattr('name','equalto','mamba') | list) else None }}"
     conda_executable: "{{ conda_path ~ '/bin/mamba' if (((conda_version_check.stdout | from_json) | selectattr('name','equalto','mamba') | list | length) > 0) else conda_path ~ '/bin/conda' }}"
 
 # Always install conda and mamba from conda-forge