Fix exception when adding quickmark with empty name.

This commit is contained in:
Florian Bruhin 2014-09-25 06:54:49 +02:00
parent 9a05e64bf8
commit e029139764

View File

@ -78,10 +78,14 @@ def quickmark_add(url, name):
url: The url to add as quickmark. url: The url to add as quickmark.
name: The name for the new quickmark. name: The name for the new quickmark.
""" """
# We don't raise cmdexc.CommandError here as this can be called async via
# prompt_save.
if not name: if not name:
raise cmdexc.CommandError("Can't set mark with empty name!") message.error("Can't set mark with empty name!")
return
if not url: if not url:
raise cmdexc.CommandError("Can't set mark with empty URL!") message.error("Can't set mark with empty URL!")
return
def set_mark(): def set_mark():
"""Really set the quickmark.""" """Really set the quickmark."""