You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Problem Transform.select(editor: Editor, target: Location) will use whatever target it is provided without checking it actually exists or if it points to leaf nodes.
Solution
Adding code that checks whether the target location exists and it is indeed leaf node. If it is not leaf node, it will use Editor.first(editor: Editor, at: Location).
Alternatives
Not adding code for checking. User might be surprised when s/he tries to select node at [0] and editor will crash or do something unexpected.
The text was updated successfully, but these errors were encountered:
Problem
Transform.select(editor: Editor, target: Location)
will use whatevertarget
it is provided without checking it actually exists or if it points to leaf nodes.Solution
Adding code that checks whether the target location exists and it is indeed leaf node. If it is not leaf node, it will use
Editor.first(editor: Editor, at: Location)
.Alternatives
Not adding code for checking. User might be surprised when s/he tries to select node at
[0]
and editor will crash or do something unexpected.The text was updated successfully, but these errors were encountered: