Skip to content

Commit

Permalink
Error when closing MP file dialog without name, thonny#1431
Browse files Browse the repository at this point in the history
  • Loading branch information
aivarannamaa committed Nov 26, 2020
1 parent a498597 commit 00687d8
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion thonny/base_file_browser.py
Original file line number Diff line number Diff line change
Expand Up @@ -1156,8 +1156,12 @@ def on_ok(self, event=None):
tree = self.browser.tree
name = self.name_var.get()

if not name:
messagebox.showerror(tr("Error"), tr("You need to select a file!"), master=self)
return

for node_id in tree.get_children(""):
if name == tree.set(node_id, "name"):
if name and name == tree.set(node_id, "name"):
break
else:
node_id = None
Expand Down

0 comments on commit 00687d8

Please sign in to comment.