Handle invalid URLs on Apple events
This commit is contained in:
parent
ada15510a7
commit
eeb565319f
@ -840,7 +840,11 @@ class Application(QApplication):
|
|||||||
def event(self, e):
|
def event(self, e):
|
||||||
"""Handle macOS FileOpen events."""
|
"""Handle macOS FileOpen events."""
|
||||||
if e.type() == QEvent.FileOpen:
|
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:
|
else:
|
||||||
return super().event(e)
|
return super().event(e)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user