Elementa
Elementa copied to clipboard
Fix SiblingConstraint Crash: Add Size check before getting child
The new code checks if index - 1 is possible for the children array, and if its not return the value without it, this is better than before because before if the children's size changes quickly, in my case for a search bar only showing certain results, and sometimes it would crash, this fixes that crash.
If I'm understanding correctly, this is for cases where component.parent.children.indexOf(component) is -1, but this being true seems like it would only occur when something "illegal" is being done (like operations from another thread). Can you provide a minimal example that reproduces this, if it is really a bug that should be fixed in Elementa?
yes @DJtheRedstoner, I have run into this crash when quickly hiding and unhiding elements, in this example its when I press the features "options" button (the gear) that can be found on lines #649-661, I can't force it to happen, and seemed to happen almost randomly when clicking on the gear, sometimes it would crash other times it would be fine, but the times it did crash it always pointed to that file having a input of -1 and it checking children[-2] thus crashing with array out of bounds .