ignore missing matches records in widget master v0.5
authorMischa POSLAWSKY <perl@shiar.org>
Thu, 22 Aug 2019 01:20:07 +0000 (03:20 +0200)
committerMischa POSLAWSKY <perl@shiar.org>
Thu, 22 Aug 2019 01:20:07 +0000 (03:20 +0200)
Support previously generated data.

widget.html

index 363f70ae24c6c7a35d3ba9ad631d092b005f8ab9..ccc9e78af0b2fbef82fbc963cac13fe736b1536b 100644 (file)
@@ -58,7 +58,7 @@
                        `).join('')}
                        </ul>
                        <ul class=matches>
-                       ${clan.matches.splice(0, 3).map(match => `
+                       ${(clan.matches || []).splice(0, 3).map(match => `
                                <li data-members="${match.players}" class=${match.decision.toLowerCase()}>
                                        ${matchtime(new Date(match.date * 1000))} ${match.type}
                                </li>