Skip to content

Commit 8903a33

Browse files
committed
fix crash on empty model group
1 parent 203b873 commit 8903a33

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tools/gen-models.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ for (let [model, group] of Object.entries(dumpGrouped)) {
121121
const otaIdPrefix = v.ota_id ?? (groups && [groups.machine, groups.machine2].map(x => machineOtaIdPrefix[x])?.find(v => v)?.[0]);
122122
return `${prefix}-${v.model.sized}-${minor}-${otaIdPrefix?.substring(7, 11) ?? 'ZZZZ'}`;
123123
});
124-
if (group[0].ota_id) {
124+
if (group[0]?.ota_id) {
125125
const year = group[0].ota_id.substring(8, 10);
126126
group = group.filter(v => {
127127
if (!v.ota_id) {

0 commit comments

Comments
 (0)