mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-18 23:42:17 +00:00
gridlogic: return null for impossible updates instead of throwing an error
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user