diff --git a/mpsd-software-environment.py b/mpsd-software-environment.py
index 7925e7b29668aa9e1cb38dc848d87aee21ced53e..c208654749f8581068954546a5c499100341e1bc 100755
--- a/mpsd-software-environment.py
+++ b/mpsd-software-environment.py
@@ -94,6 +94,8 @@ def create_log_file_names(
         # if toolchain is given, then  we build the build_log_file_name
         if action in ["install", "remove"]:
             log_template = config_vars["build_log_template"]
+        else:
+            return None
     else:
         # if toolchain is not given, then we build the installer_log_file_name
         log_template = config_vars["installer_log_template"]