(shapes which do have incoming connectors, but have no outgoing connectors, like the daughter node below)
If we ask omniJS for the .children property of the leaf node here, in lieu of the expected empty array, we are currently getting a full and instant app crash.
TEST
Create a pair of shapes and link them, so that we have a parent and a child
Ask omniJS (through the virtual root -> real parent -> leaf-child chain) for any .children of the child node by pasting the following into the Automation Console and hitting return.
PS given that in an empty document (where canvas.outlineRoot is itself a kind of leaf with no children) this works fine:
and given also that (for the moment at least) the API lists the type of OGOutlineNode.children as Array, I think the most useful behaviour would be for leaf shapes to return an empty Array ( [ ] rather than undefined or null) from OGOutlineNode.children
In the meanwhile, if anyone is in a hurry to traverse diagram structures with the OGOutlineNodes interface (which, unlike .graphic.outgoingLines, lets a script know sibling sequences as well as parent-child nesting) we can still reroute to bypass the crash by testing for leaf status with something like: