diff --git a/invesalius/control.py b/invesalius/control.py index 54a4639..d0e3d78 100644 --- a/invesalius/control.py +++ b/invesalius/control.py @@ -203,17 +203,18 @@ class Controller(): # Import project treating compressed nifti exception suptype = ('hdr', 'nii', 'nii.gz', 'par') filepath = dialog.ShowImportOtherFilesDialog(id_type) - name = filepath.rpartition('\\')[-1].split('.') + if filepath is not None: + name = filepath.rpartition('\\')[-1].split('.') - if name[-1] == 'gz': - name[1] = 'nii.gz' + if name[-1] == 'gz': + name[1] = 'nii.gz' - filetype = name[1].lower() + filetype = name[1].lower() - if filetype in suptype: - Publisher.sendMessage("Open other files", filepath) - else: - dialog.ImportInvalidFiles() + if filetype in suptype: + Publisher.sendMessage("Open other files", filepath) + else: + dialog.ImportInvalidFiles() def ShowDialogOpenProject(self): # Offer to save current project if necessary -- libgit2 0.21.2