diff --git a/fsl/utils/platform.py b/fsl/utils/platform.py index 21dd92a19203fdbf276ec5414d1cac6876ba9cff..df2677e7c3a9541f98704491306cdfed9e58344b 100644 --- a/fsl/utils/platform.py +++ b/fsl/utils/platform.py @@ -280,13 +280,16 @@ class Platform(notifier.Notifier): """Changes the value of the :attr:`fsldir` property, and notifies any registered listeners. """ - value = value.strip() - - if value == '': value = None + + if value is not None: + value = value.strip() + + if value is None: pass + elif value == '': value = None elif not op.exists(value): value = None elif not op.isdir(value): value = None - self.__fsldir = value + self.__fsldir = value if value is not None: os.environ['FSLDIR'] = value