- 
          
 - 
                Notifications
    
You must be signed in to change notification settings  - Fork 608
 
Description
I won't develop a full test case here, but I can describe the problem and my workaround. Suppose you have a tree where all nodes are loaded lazily. You call loadKeyPath to load the two paths in (1). Results are returned, then filtered or whatever; all good.
- /426/5376/872/876/4597, /426/5378/841/843/3103
 - /426/5378/841/845/3220, /426/5407/851/855/3691
 
You then call loadKeyPath again to load the two paths in (2). This will cause a "node is null" error. Node 841 is loaded by (1), in order to load its child node 843. Therefore, when loadKeyPath is called with the paths in (2), node 841 has already been loaded and so 845 is added as a key to loadMap. The problem is that node 5407 will also be added as a key to loadMap, since it hasn't been loaded either.
But 845 and 5407 are not children of the same root! So this later code fails:
for(key in loadMap){
    node = root._findDirectChild(key);My workaround is to replace that code with
for(key in loadMap){
    node = root._findDirectChild(key);
    if (node == null) {
        node = self.getNodeByKey(key);
    }