if AsyncLoad parameter is None, do not try to open it, and Async returns None
This fixes a bug with LCL for transactions without details
This commit is contained in:
parent
e6a80af479
commit
a9b86d60a5
1 changed files with 4 additions and 1 deletions
|
|
@ -193,7 +193,7 @@ class _Selector(Filter):
|
|||
class AsyncLoad(Filter):
|
||||
def __call__(self, item):
|
||||
link = self.select(self.selector, item, key=self._key, obj=self._obj)
|
||||
return item.page.browser.async_open(link)
|
||||
return item.page.browser.async_open(link) if link else None
|
||||
|
||||
|
||||
class Async(_Filter):
|
||||
|
|
@ -209,6 +209,9 @@ class Async(_Filter):
|
|||
return self
|
||||
|
||||
def __call__(self, item):
|
||||
if item.loaders[self.name] is None:
|
||||
return None
|
||||
|
||||
result = item.loaders[self.name].result()
|
||||
assert result.page is not None, 'The loaded url %s hasn\'t been matched by an URL object' % result.url
|
||||
return self.selector(result.page.doc)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue