Handle open dialog canceled

This commit is contained in:
Michael Stevenson 2022-11-28 09:33:39 -08:00
parent da90d86bbd
commit ba7e2a5328
1 changed files with 4 additions and 1 deletions

View File

@ -60,7 +60,10 @@ class ImageView(tk.Frame):
self.caption_frame.pack(fill=tk.Y, side=tk.RIGHT) self.caption_frame.pack(fill=tk.Y, side=tk.RIGHT)
def open_folder(self): def open_folder(self):
self.base_path = Path(filedialog.askdirectory()) dir = filedialog.askdirectory()
if not dir:
return
self.base_path = Path(dir)
if self.base_path is None: if self.base_path is None:
return return
self.images.clear() self.images.clear()