Don't crash when there is no match
This commit is contained in:
parent
ea95c82b37
commit
fc0d6f114a
|
@ -283,10 +283,15 @@ def article_page(url_title: str) -> str | Response:
|
||||||
|
|
||||||
by_title = {hit["title"]: hit for hit in hits}
|
by_title = {hit["title"]: hit for hit in hits}
|
||||||
|
|
||||||
|
found = None
|
||||||
if article_title in by_title:
|
if article_title in by_title:
|
||||||
hit = by_title[article_title]
|
hit = by_title[article_title]
|
||||||
found = get_diff(from_title, hit["title"], None)
|
try:
|
||||||
else:
|
found = get_diff(from_title, hit["title"], None)
|
||||||
|
except NoMatch:
|
||||||
|
pass
|
||||||
|
|
||||||
|
if not found:
|
||||||
after = flask.request.args.get("after")
|
after = flask.request.args.get("after")
|
||||||
if after:
|
if after:
|
||||||
print(after)
|
print(after)
|
||||||
|
|
Loading…
Reference in a new issue