Skip to content

Commit 4291ff6

Browse files
committed
BUGFIX:
- MizEdit: FileNotFound if terrain was uninstalled but terrain directory was still there.
1 parent 565cb30 commit 4291ff6

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

core/mizfile.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,9 @@ def read_theatres(self):
5555
for terrain in os.listdir(maps_path):
5656
terrain_path = os.path.join(maps_path, terrain)
5757
entry_lua = os.path.join(terrain_path, "entry.lua")
58+
# sometimes, terrain folders stay even if the terrain is being uninstalled
59+
if not os.path.exists(entry_lua):
60+
continue
5861
pattern = r'local self_ID\s*=\s*"(.*?)";'
5962
with open(entry_lua, "r", encoding="utf-8") as file:
6063
match = re.search(pattern, file.read())

0 commit comments

Comments
 (0)