diff --git a/utils.py b/utils.py index 16585d2..ec78e85 100644 --- a/utils.py +++ b/utils.py @@ -1,8 +1,8 @@ #!/usr/bin/python3 +import os import sys from pathlib import Path -from PyQt6.QtCore import Qt from PyQt6.QtWidgets import QMessageBox from file import File @@ -110,5 +110,6 @@ class Utils: if len(sys.argv) == 1: # if no parameters were passed to the editor file_path = self.app.settings.last_opened_file - file = File(self.app, file_path, file_path.split("/")[-1]) - self.app.open_files[file_path] = file + if os.path.isfile(file_path): + file = File(self.app, file_path, file_path.split("/")[-1]) + self.app.open_files[file_path] = file