| Summary: | DefautProvider#buildEdges may throw a NPE | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Modeling] GMF-Runtime | Reporter: | Esteban DUGUEPEROUX <esteban.dugueperoux> | ||||
| Component: | General | Assignee: | Aurelien Pupier <apupier> | ||||
| Status: | RESOLVED FIXED | QA Contact: | |||||
| Severity: | normal | ||||||
| Priority: | P3 | CC: | apupier | ||||
| Version: | unspecified | ||||||
| Target Milestone: | 1.5.0 | ||||||
| Hardware: | PC | ||||||
| OS: | Linux | ||||||
| See Also: | https://bugs.eclipse.org/bugs/show_bug.cgi?id=282380 | ||||||
| Whiteboard: | |||||||
| Attachments: |
|
||||||
Created attachment 186379 [details]
fix which prevents a possible NPE.
Hi, Can you be more precise in which case it can occured? From my understanding of the code, it is that your ConnectionEditpart have no source or no target. Can you confirm that in order to be sure that it doesn't hide another issue? This use case seems plausible for me. I applied your patch and do the same modifications some lines above. Thanks for the report and the patch fix applied for 1.5.0 |
Build Identifier: I20101208-1300 DefautProvider#buildEdges contains currently the following code : EditPart from = poly.getSource(); EditPart to = poly.getTarget(); if (from instanceof IBorderItemEditPart && !editPartToNodeDict.containsKey(from)) from = from.getParent(); else if (shouldHandleListItems && from instanceof ListItemEditPart) from = getFirstAnscestorinNodesMap(from, editPartToNodeDict); if (to instanceof IBorderItemEditPart && !editPartToNodeDict.containsKey(to)) to = to.getParent(); else if (shouldHandleListItems && to instanceof ListItemEditPart) to = getFirstAnscestorinNodesMap(to, editPartToNodeDict); Node fromNode = (Node) editPartToNodeDict.get(from); Node toNode = (Node) editPartToNodeDict.get(to); If fromNode or toNode is null, HashTable#get will throw a NullPointerException We get a case where it occured. Reproducible: Always