Skip to content

Commit 16e054d

Browse files
committed
Skip incomplete avatars when laying out images
1 parent 3019b5e commit 16e054d

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

scripts/update-svgs.js

+6-4
Original file line numberDiff line numberDiff line change
@@ -131,10 +131,12 @@ function layoutItems(items, data, y) {
131131
while (i < items.length) {
132132
const item = items[i]
133133
const image = item.image
134-
const newW = w + image.width + (w > 0 ? margin(image.height) : 0)
135-
if (newW >= WIDTH - 20) break // leave a little space around
136-
rowItems.push(item)
137-
w = newW
134+
if (image) {
135+
const newW = w + image.width + (w > 0 ? margin(image.height) : 0)
136+
if (newW >= WIDTH - 20) break // leave a little space around
137+
rowItems.push(item)
138+
w = newW
139+
}
138140
++i
139141
}
140142
x = (WIDTH - w) >>> 1

0 commit comments

Comments
 (0)