mantidproject / mantidimaging

Graphical toolkit for neutron imaging.
https://mantidproject.github.io/mantidimaging
GNU General Public License v3.0
13 stars 6 forks source link

Live viewer: UnboundLocalError: local variable 'images' referenced before assignment #2219

Closed samtygier-stfc closed 3 months ago

samtygier-stfc commented 3 months ago

Summary

Error received when deleting files from a life viewer directory

Steps To Reproduce

With live viewer open Delete the directory that the live viewer is watching. e.g. rm -rf /tmp/live_test/

Expected Behaviour

Live viewer goes blank or good error message

Current Behaviour

Error message

Context

Current main

Failure Logs

2024-06-06 12:44:59,878 [mantidimaging.gui.windows.live_viewer.presenter:L93] ERROR: FileNotFoundError reading image: /tmp/live_test/image_9991.tiff: [Errno 2] No such file or directory: '/tmp/live_test/image_9991.tiff'
_handle_directory_change /tmp/live_test
2024-06-06 12:44:59,886 [mantidimaging.gui.windows.main.view:L566] ERROR: Traceback (most recent call last):
  File "/home/sam/git/mantidimaging/mantidimaging/gui/windows/live_viewer/model.py", line 251, in _handle_directory_change
    images = self.sort_images_by_modified_time(images)
UnboundLocalError: local variable 'images' referenced before assignment