From 8f2616ef5ba46af133d93c980681ba24bb37165e Mon Sep 17 00:00:00 2001 From: nyanpasu64 Date: Tue, 26 Nov 2024 22:12:07 -0800 Subject: [PATCH] When opening missing file via CLI, show dialog rather than crashing --- CHANGELOG.md | 4 ++++ corrscope/gui/__init__.py | 7 +++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 515051b..99843a6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,10 @@ - Encode audio using libopus instead of aac (#487) - Fix loss of volume when using a mono track as master audio (#488) +### Changelog + +- When opening missing file via CLI, show dialog rather than crashing (#499) + ## 0.10.1 ### Changelog diff --git a/corrscope/gui/__init__.py b/corrscope/gui/__init__.py index a383a95..2ca5792 100644 --- a/corrscope/gui/__init__.py +++ b/corrscope/gui/__init__.py @@ -390,13 +390,12 @@ class MainWindow(qw.QMainWindow, Ui_MainWindow): if self.model is None: self.load_cfg(template_config(), None) - assert cfg_path.is_file() self.pref.file_dir = str(cfg_path.parent.resolve()) - # Raises YAML structural exceptions - cfg = yaml.load(cfg_path) - try: + # Raises YAML structural exceptions + cfg = yaml.load(cfg_path) + # Raises color getter exceptions self.load_cfg(cfg, cfg_path) except Exception as e: