From 93a73e0248c90483f1495b9ca8a24f25ad472e55 Mon Sep 17 00:00:00 2001 From: dece Date: Mon, 13 Dec 2021 15:04:39 +0100 Subject: [PATCH] wordreference: prevent some crash i guess --- wordreference.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/wordreference.py b/wordreference.py index d2eab8a..dae519f 100755 --- a/wordreference.py +++ b/wordreference.py @@ -192,7 +192,9 @@ def parse_common_cells(cells, meaning, is_new_meaning): def parse_example_cells(cells, meaning): """Parse cells of an example line (pretty much just the last one).""" - meaning.ex.append(cells[-1].span.text) + last_cell = cells[-1] + if (span := last_cell.span): + meaning.ex.append(span.text) def print_meaning(meaning):