Refactor code

This commit is contained in:
Ismail S 2016-07-08 15:33:13 +01:00
parent 3b0fb84c47
commit babbd0771c

View File

@ -1122,13 +1122,13 @@ class CommandDispatcher:
raise cmdexc.CommandError('Title must be provided if url has ' raise cmdexc.CommandError('Title must be provided if url has '
'been provided') 'been provided')
bookmark_manager = objreg.get('bookmark-manager') bookmark_manager = objreg.get('bookmark-manager')
if isinstance(url, str): if url is None:
url = self._current_url()
else:
try: try:
url = urlutils.fuzzy_url(url) url = urlutils.fuzzy_url(url)
except urlutils.InvalidUrlError as e: except urlutils.InvalidUrlError as e:
raise cmdexc.CommandError(e) raise cmdexc.CommandError(e)
elif not url:
url = self._current_url()
if not title: if not title:
title = self._current_title() title = self._current_title()
try: try: