gridlogic: return null for impossible updates instead of throwing an error

This commit is contained in:
chfhtw
2026-04-15 13:55:07 +02:00
parent 910e960e4f
commit 88c82a41ba
+4 -2
View File
@@ -91,7 +91,7 @@ class GridLogic {
return result;
} else {
console.error('FATAL', "can't arrange item on grid");
return null;
}
}
}
@@ -151,7 +151,9 @@ class GridLogic {
}
const updates = this.add(currItem, prefer);
updates[item.index] = {index: item.index, x, y};
if (updates)
updates[item.index] = {index: item.index, x, y};
return updates;
}
resize(item, w, h) {