Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid W. Miller2018-11-15 15:26:36 -0500
committerDonald Dunne2018-11-15 17:13:55 -0500
commitda1ed31cc4e776e704ac8e1342be9464c8eafd58 (patch)
treeacc78f7e30e102fcc4e9c4ce3ee0020671c34522
parenta2c9d48cd23144b01ac95a77a3041da037e94392 (diff)
downloadorg.eclipse.osee-da1ed31cc4e776e704ac8e1342be9464c8eafd58.tar.gz
org.eclipse.osee-da1ed31cc4e776e704ac8e1342be9464c8eafd58.tar.xz
org.eclipse.osee-da1ed31cc4e776e704ac8e1342be9464c8eafd58.zip
bug[ats_TW11774]: Fix Branch graph NPE
-rw-r--r--plugins/org.eclipse.osee.framework.ui.branch.graph/src/org/eclipse/osee/framework/ui/branch/graph/model/GraphLoader.java11
1 files changed, 9 insertions, 2 deletions
diff --git a/plugins/org.eclipse.osee.framework.ui.branch.graph/src/org/eclipse/osee/framework/ui/branch/graph/model/GraphLoader.java b/plugins/org.eclipse.osee.framework.ui.branch.graph/src/org/eclipse/osee/framework/ui/branch/graph/model/GraphLoader.java
index 00c400914d..2d1a1df82e 100644
--- a/plugins/org.eclipse.osee.framework.ui.branch.graph/src/org/eclipse/osee/framework/ui/branch/graph/model/GraphLoader.java
+++ b/plugins/org.eclipse.osee.framework.ui.branch.graph/src/org/eclipse/osee/framework/ui/branch/graph/model/GraphLoader.java
@@ -14,6 +14,7 @@ import java.util.ArrayList;
import java.util.List;
import java.util.logging.Level;
import org.eclipse.osee.framework.core.data.BranchId;
+import org.eclipse.osee.framework.core.model.TransactionRecord;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.logging.OseeLog;
import org.eclipse.osee.framework.skynet.core.artifact.BranchManager;
@@ -64,7 +65,10 @@ public class GraphLoader {
List<BranchId> branches = new ArrayList<>(BranchManager.getChildBranches(current.getBranch(), recurse));
branches.add(current.getBranch());
for (BranchId branch : branches) {
- joinQuery.add(BranchManager.getSourceTransaction(branch).getId());
+ TransactionRecord tr = BranchManager.getSourceTransaction(branch);
+ if (tr != null) {
+ joinQuery.add(tr.getId());
+ }
}
joinQuery.store();
@@ -95,7 +99,10 @@ public class GraphLoader {
} else {
long parentTxId = 0;
try {
- parentTxId = BranchManager.getSourceTransaction(branchModel.getBranch()).getId();
+ TransactionRecord tr = BranchManager.getSourceTransaction(branchModel.getBranch());
+ if (tr != null) {
+ parentTxId = tr.getId();
+ }
} catch (OseeCoreException ex) {
OseeLog.log(Activator.class, Level.SEVERE, ex);
}

Back to the top