diff --git a/deluge/ui/gtkui/addtorrenturl.py b/deluge/ui/gtkui/addtorrenturl.py index 9a0e69012..5145fa66b 100644 --- a/deluge/ui/gtkui/addtorrenturl.py +++ b/deluge/ui/gtkui/addtorrenturl.py @@ -64,7 +64,7 @@ class AddTorrentUrl: self.response = self.dlg.run() url = self.entry.get_text() self.dlg.destroy() - if self.response == 1: + if self.response == 1 and deluge.common.is_url(url): return url else: return None diff --git a/deluge/ui/gtkui/menubar.py b/deluge/ui/gtkui/menubar.py index 98def96fd..7252806b6 100644 --- a/deluge/ui/gtkui/menubar.py +++ b/deluge/ui/gtkui/menubar.py @@ -102,7 +102,9 @@ class MenuBar: def on_menuitem_addurl_activate(self, data=None): log.debug("on_menuitem_addurl_activate") from addtorrenturl import AddTorrentUrl - functions.add_torrent_url(AddTorrentUrl().run()) + result = AddTorrentUrl().run() + if result is not None: + functions.add_torrent_url(result) def on_menuitem_clear_activate(self, data=None): log.debug("on_menuitem_clear_activate")