Fix meaning-tag IndexError bug

This commit is contained in:
Oystein Kristoffer Tveit 2022-02-12 23:00:27 +01:00
parent 0941a2f4d1
commit cf70eea0a1
1 changed files with 3 additions and 2 deletions

View File

@ -159,11 +159,12 @@ PhrasePageScrapeResultData _getMeaningsOtherFormsAndNotes(
var notes;
for (var child in meaningsWrapper.children) {
final mostRecentWordType = mostRecentWordTypes.length >= 1 ? mostRecentWordTypes[0] : null;
if (child.className.contains('meaning-tags')) {
mostRecentWordTypes = _getMostRecentWordTypes(child);
} else if (mostRecentWordTypes[0] == 'other forms') {
} else if (mostRecentWordType == 'other forms') {
otherForms = _getOtherForms(child);
} else if (mostRecentWordTypes[0] == 'notes') {
} else if (mostRecentWordType == 'notes') {
notes = _getNotes(child);
} else {
meanings.add(_getMeaning(child));