#2028 - Null check
This commit is contained in:
@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user