Skip to content

Commit

Permalink
Don't crash when importing XMI 1.1 with no Status field
Browse files Browse the repository at this point in the history
The GUI would report problems when opening a XMI file that has an element with no 'status' attribute. Now a check is made to ensure that the status field is present or not, and is ignored if not present.

Export of data was checked and works as expected. DocBook will not provide status information if it wasn't in the original requirement.

Issue: DOTNET-153
  • Loading branch information
jcurl committed May 1, 2018
1 parent 30c3b83 commit a9c0288
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions EAExport/EAExportForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ private void BuildTree(TreeNode parent, Model.EATree element, TreeStatistics sta
node.ImageKey = "Model";
} else if (element.Id.StartsWith("EAPK")) {
node.ImageKey = "Specification";
} else {
} else if (element.Status != null) {
if (element.Status.Equals("Approved", StringComparison.InvariantCultureIgnoreCase)) {
node.ImageKey = "RequirementApproved";
} else if (element.Status.Equals("Implemented", StringComparison.InvariantCultureIgnoreCase)) {
Expand All @@ -146,6 +146,8 @@ private void BuildTree(TreeNode parent, Model.EATree element, TreeStatistics sta
} else {
node.ImageKey = "Requirement";
}
} else {
node.ImageKey = "Requirement";
}
node.SelectedImageKey = node.ImageKey;

Expand All @@ -164,7 +166,7 @@ private void treXmiStructure_AfterSelect(object sender, TreeViewEventArgs e)
htmlNotes.Text = element.Text;
txtAlias.Text = element.Alias;
txtAuthor.Text = element.Author;
txtStatus.Text = element.Status;
txtStatus.Text = element.Status == null ? "" : element.Status;
txtStereotype.Text = element.Stereotype;
txtVersion.Text = element.Version;
txtCreateTime.Text = element.CreateTime.Ticks == 0 ? string.Empty : element.CreateTime.ToString("g");
Expand Down

0 comments on commit a9c0288

Please sign in to comment.