forked from Wobbl/Bread_Editor
Fixed a crash.
The editor wasn't checking if the last opened file actually existed, so when it didn't exist, it crashed every time.
This commit is contained in:
parent
047fcbe856
commit
917d59a139
1 changed files with 4 additions and 3 deletions
3
utils.py
3
utils.py
|
@ -1,8 +1,8 @@
|
||||||
#!/usr/bin/python3
|
#!/usr/bin/python3
|
||||||
|
|
||||||
|
import os
|
||||||
import sys
|
import sys
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from PyQt6.QtCore import Qt
|
|
||||||
from PyQt6.QtWidgets import QMessageBox
|
from PyQt6.QtWidgets import QMessageBox
|
||||||
from file import File
|
from file import File
|
||||||
|
|
||||||
|
@ -110,5 +110,6 @@ class Utils:
|
||||||
if len(sys.argv) == 1: # if no parameters were passed to the editor
|
if len(sys.argv) == 1: # if no parameters were passed to the editor
|
||||||
file_path = self.app.settings.last_opened_file
|
file_path = self.app.settings.last_opened_file
|
||||||
|
|
||||||
|
if os.path.isfile(file_path):
|
||||||
file = File(self.app, file_path, file_path.split("/")[-1])
|
file = File(self.app, file_path, file_path.split("/")[-1])
|
||||||
self.app.open_files[file_path] = file
|
self.app.open_files[file_path] = file
|
||||||
|
|
Loading…
Add table
Reference in a new issue