diff --git a/fsl/utils/filetree/filetree.py b/fsl/utils/filetree/filetree.py index 151583e30c9a88ec645eceb1bdc9868c642ff5f7..edcccc9fbefaf7fe6431de2234588ac2cd006831 100644 --- a/fsl/utils/filetree/filetree.py +++ b/fsl/utils/filetree/filetree.py @@ -48,10 +48,11 @@ class FileTree(object): """ All tree variables including those from the parent tree """ + without_none = {key: value for key, value in self.variables.items() if value is not None} if self.parent is None: - return dict(self.variables) + return without_none res = self.parent.all_variables - res.update(self.variables) + res.update(without_none) return res def get_variable(self, name: str) -> str: