mirror of
https://github.com/penpot/penpot.git
synced 2026-03-26 03:01:16 -04:00
* 🐛 Fix nil deref on missing bounds in layout modifier propagation When a parent shape has a child ID in its shapes vector that does not exist in the objects map, the layout modifier code crashes because it derefs nil from the bounds map. The root cause is that children from the parent shapes list are not validated against the objects map before being passed to the layout modifier pipeline. Children with missing IDs pass through unchecked and reach apply-modifiers where bounds lookup fails. Fix by adding nil guards in apply-modifiers to skip children without bounds, and changing map to keep to filter them out. Signed-off-by: Andrey Antukh <niwi@niwi.nz> * 📎 Add tests for nil bounds in layout modifier propagation Tests cover flex and grid layout scenarios where a parent frame has child IDs in its shapes vector that do not exist in the objects map, verifying that set-objects-modifiers handles these gracefully without crashing. Tests: - Flex layout with normal children (baseline) - Flex layout with non-existent child in shapes - Flex layout with only non-existent children - Grid layout with non-existent child in shapes - Flex layout resize propagation with ghost children - Nested flex layout with non-existent child in outer frame Signed-off-by: Andrey Antukh <niwi@niwi.nz> --------- Signed-off-by: Andrey Antukh <niwi@niwi.nz>