Skip to content

Commit

Permalink
Merge pull request #21853 from Yoast/1993-240-new-free-old-premium-ty…
Browse files Browse the repository at this point in the history
…peerror-cannot-read-properties-of-undefined-reading-list-assessments-are-broken

Add defensive check if the list is available in the morphology data before retrieving it
  • Loading branch information
mykola authored Nov 22, 2024
2 parents 6a4de15 + 9b9be7e commit dbbcd8d
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,9 @@ export function determineRegularStem( word, morphologyData ) {
Please note that if the adjective ends in -y and -e, the ending is removed, e.g. 'acute' -> 'acut'.
The list is not exhaustive and can be expanded if needed. Oxford dictionary was used to check if the forms indeed exist, e.g. "acuter".
*/
const multiSyllableAdjWithSuffixes = morphologyData.adjectives.multiSyllableAdjectives.list;
const multiSyllableAdjWithSuffixes = morphologyData.adjectives.multiSyllableAdjectives
? morphologyData.adjectives.multiSyllableAdjectives.list
: [];

const baseIfAdjective = getAdjectiveStem( word, regexAdjective, stopAdjectives, multiSyllableAdjWithSuffixes ).base;
possibleRegularBases.push( baseIfAdjective );
Expand Down

0 comments on commit dbbcd8d

Please sign in to comment.