defect
minor
#27402
setting the value of an ordered association may lead to NullPointerException
The following sequence of commands results in a NullPointerException:
- Setting the values of an association using a "live" tl:OrderedLinkQuery (see AbstractWrapper#setOrderedValue(TLObject, OrderedLinkQuery, List))
- Requesting the "Live" list (see AbstractWrapper#resolveLinks(TLObject, AbstractAssociationQuery))
- Modifying the values of this association as described above.
=> A NullPointerException occurs
Cause
When setting the values, the orders are assigned to the links one after another. When the order is set for the first link, the association cache attempts to adjust the link’s position in the list based on the change. To do this, it searches for this link using the order comparator. The order comparator cannot handle the fact that an order (namely, the order of all subsequent links) is null.
Solution
The method must not be called with "live" queries.
Test
No test.