fix: Check for empty array in thrasos.RenderInfo.addElemSpacing_ (#6211)

* fix: Check for undefined value in InputRow.measure

* Revert "fix: Check for undefined value in InputRow.measure"

This reverts commit f2e57c06ad.

* fix: thrasos: don't push elements if array is empty

- Use same array length check as geras renderer does
This commit is contained in:
Alex Zauzolkov
2022-06-16 02:06:41 +10:00
committed by GitHub
parent d7ab81504c
commit 16b5ccd2ea

View File

@@ -82,6 +82,9 @@ class RenderInfo extends BaseRenderInfo {
row.elements.push(new InRowSpacer(
this.constants_, this.getInRowSpacing_(null, oldElems[0])));
}
if (!oldElems.length) {
continue;
}
for (let e = 0; e < oldElems.length - 1; e++) {
row.elements.push(oldElems[e]);
const spacing = this.getInRowSpacing_(oldElems[e], oldElems[e + 1]);