#2028 - Null check

This commit is contained in:
Dolan Miu
2023-03-31 00:13:36 +01:00
parent 6362b498a6
commit c3a617fefd
3 changed files with 33 additions and 0 deletions

View File

@ -8,6 +8,10 @@ export const findRunElementIndexWithToken = (paragraphElement: Element, token: s
const textElement = (element.elements ?? []).filter((e) => e.type === "element" && e.name === "w:t");
for (const text of textElement) {
if (!text.elements?.[0]) {
continue;
}
if ((text.elements?.[0].text as string)?.includes(token)) {
return i;
}