From eeb565319fd755b36b3938916bdc666523bb851e Mon Sep 17 00:00:00 2001 From: Anton S Date: Sun, 25 Feb 2018 22:42:32 +0300 Subject: [PATCH] Handle invalid URLs on Apple events --- qutebrowser/app.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/qutebrowser/app.py b/qutebrowser/app.py index ec477ce8f..c755c2f41 100644 --- a/qutebrowser/app.py +++ b/qutebrowser/app.py @@ -840,7 +840,11 @@ class Application(QApplication): def event(self, e): """Handle macOS FileOpen events.""" if e.type() == QEvent.FileOpen: - open_url(e.url(), no_raise=True) + url = e.url() + if url.isValid(): + open_url(url, no_raise=True) + else: + message.error("Invalid URL: {}".format(url.errorString())) else: return super().event(e)