Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormegumi.telles2014-09-28 18:03:19 +0000
committerRoberto E. Escobar2014-10-01 21:05:27 +0000
commit3235088182fa9f63ecfb963eea522421058cecbc (patch)
treec96e4b078756a2938050231772e8aa17a90264a0
parentbc052f8f68f409c092cd6ce898a5fccdc483a04e (diff)
downloadorg.eclipse.osee-3235088182fa9f63ecfb963eea522421058cecbc.tar.gz
org.eclipse.osee-3235088182fa9f63ecfb963eea522421058cecbc.tar.xz
org.eclipse.osee-3235088182fa9f63ecfb963eea522421058cecbc.zip
bug[ats_ATS107278]: Fix DataRightBuilder null pointer exception
-rw-r--r--plugins/org.eclipse.osee.define.report/src/org/eclipse/osee/define/report/internal/DataRightBuilder.java32
1 files changed, 18 insertions, 14 deletions
diff --git a/plugins/org.eclipse.osee.define.report/src/org/eclipse/osee/define/report/internal/DataRightBuilder.java b/plugins/org.eclipse.osee.define.report/src/org/eclipse/osee/define/report/internal/DataRightBuilder.java
index 9ece9ded06d..b809dd26997 100644
--- a/plugins/org.eclipse.osee.define.report/src/org/eclipse/osee/define/report/internal/DataRightBuilder.java
+++ b/plugins/org.eclipse.osee.define.report/src/org/eclipse/osee/define/report/internal/DataRightBuilder.java
@@ -10,6 +10,7 @@
*******************************************************************************/
package org.eclipse.osee.define.report.internal;
+import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.Iterator;
@@ -113,20 +114,23 @@ public class DataRightBuilder {
Map<String, DataRight> toReturn = new HashMap<String, DataRight>();
@SuppressWarnings("unchecked")
- ArtifactReadable footerMappingArt = query.andIds(MAPPING_ARTIFACT).getResults().getExactlyOne();
-
- List<String> footers = footerMappingArt.getAttributeValues(CoreAttributeTypes.GeneralStringData);
- for (String footer : footers) {
- String[] enumToFooter = footer.split("\\n", 2);
- if (enumToFooter.length == 2) {
- DataRightId id = new DataRightId();
- id.setId(GUID.create());
-
- DataRight dataRight = new DataRight();
- dataRight.setId(id);
- dataRight.setContent(enumToFooter[1].trim());
-
- toReturn.put(enumToFooter[0].trim(), dataRight);
+ ArtifactReadable footerMappingArt = query.andIds(MAPPING_ARTIFACT).getResults().getOneOrNull();
+
+ if (footerMappingArt != null) {
+ List<String> footers = new ArrayList<String>();
+ footers = footerMappingArt.getAttributeValues(CoreAttributeTypes.GeneralStringData);
+ for (String footer : footers) {
+ String[] enumToFooter = footer.split("\\n", 2);
+ if (enumToFooter.length == 2) {
+ DataRightId id = new DataRightId();
+ id.setId(GUID.create());
+
+ DataRight dataRight = new DataRight();
+ dataRight.setId(id);
+ dataRight.setContent(enumToFooter[1].trim());
+
+ toReturn.put(enumToFooter[0].trim(), dataRight);
+ }
}
}

Back to the top