Jaded-Encoding-Thaumaturgy / vs-preview

Previewer for VapourSynth scripts.
Apache License 2.0
57 stars 16 forks source link

Vspreview crashes when script errors are resolved #57

Closed LightArrowsEXE closed 1 year ago

LightArrowsEXE commented 1 year ago

When loading up a vspreview script (possibly for the first time?), if you run into any error and reload vspreview after fixing it, it will print out the following error:

Traceback (most recent call last):
  File "C:\Users\light\AppData\Local\Programs\Python\Python310\lib\site-packages\vspreview\main\dialog.py", line 43, in on_reload_clicked
    self.main.reload_script()
  File "C:\Users\light\AppData\Local\Programs\Python\Python310\lib\site-packages\vspreview\main\window.py", line 471, in reload_script
    self.load_script(self.script_path, reloading=True)
  File "C:\Users\light\AppData\Local\Programs\Python\Python310\lib\site-packages\vspreview\main\window.py", line 271, in load_script
    self.change_video_viewmode(self.current_viewmode)
  File "C:\Users\light\AppData\Local\Programs\Python\Python310\lib\site-packages\vspreview\core\abstracts.py", line 330, in change_video_viewmode
    self.outputs.switchToNormalView()
AttributeError: 'list' object has no attribute 'switchToNormalView'

The error can be anything, so long as it makes vspreview error.

Reproduction steps:

1) Save the following script to a new file:

from lvsfunc import source

src = source("PATH/TO/A/VIDEO")

raise ValueError

src.set_output()

Replace PATH/TO/A/VIDEO with a path to a video.

2) Start vspreview 3) Get an error because you raised a ValueError 4) Remove the raise ValueError line and refresh vspreview 5) vspreview will crash and return the above error.

Setsugennoao commented 1 year ago

Eventually fixed, I don't remember the commit