Skip to content
This repository has been archived by the owner on Mar 11, 2021. It is now read-only.

Commit

Permalink
Bug fix: null pointer exception on xmi importation.
Browse files Browse the repository at this point in the history
  • Loading branch information
johnguerson committed Mar 10, 2018
1 parent da3cc6b commit a0f0b18
Showing 1 changed file with 16 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -171,12 +171,23 @@ else if (stelem.hasAttribute("base_Association"))
elementType = "Association";
elem = doc.getElementById(stelem.getAttribute("base_Association"));
List<Element> memberEnds = XMLDOMUtil.getElementChildsByTagName(elem, "memberEnd");
Element memberPrp = doc.getElementById(memberEnds.get(0).getAttribute("xmi:idref"));
Element memberPrp = doc.getElementById(memberEnds.get(0).getAttribute("xmi:idref"));
Element memberTyp = XMLDOMUtil.getFirstAppearanceOf(memberPrp, "type");
source = doc.getElementById(memberTyp.getAttribute("xmi:idref")).getAttribute("name");
memberPrp = doc.getElementById(memberEnds.get(1).getAttribute("xmi:idref"));
memberTyp = XMLDOMUtil.getFirstAppearanceOf(memberPrp, "type");
target = doc.getElementById(memberTyp.getAttribute("xmi:idref")).getAttribute("name");
if(memberTyp!=null){
source = doc.getElementById(memberTyp.getAttribute("xmi:idref")).getAttribute("name");
if(memberPrp!=null){
memberPrp = doc.getElementById(memberEnds.get(1).getAttribute("xmi:idref"));
}
}
if(memberPrp!=null){
memberTyp = XMLDOMUtil.getFirstAppearanceOf(memberPrp, "type");
if(memberTyp!=null){
Element a = doc.getElementById(memberTyp.getAttribute("xmi:idref"));
if(a!=null){
target = a.getAttribute("name");
}
}
}
}
else if (stelem.hasAttribute("base_Property"))
{
Expand Down

0 comments on commit a0f0b18

Please sign in to comment.