diff options
author | David W. Miller | 2018-11-15 20:26:36 +0000 |
---|---|---|
committer | Donald Dunne | 2018-11-15 22:13:55 +0000 |
commit | da1ed31cc4e776e704ac8e1342be9464c8eafd58 (patch) | |
tree | acc78f7e30e102fcc4e9c4ce3ee0020671c34522 | |
parent | a2c9d48cd23144b01ac95a77a3041da037e94392 (diff) | |
download | org.eclipse.osee-da1ed31cc4e776e704ac8e1342be9464c8eafd58.tar.gz org.eclipse.osee-da1ed31cc4e776e704ac8e1342be9464c8eafd58.tar.xz org.eclipse.osee-da1ed31cc4e776e704ac8e1342be9464c8eafd58.zip |
bug[ats_TW11774]: Fix Branch graph NPE
Change-Id: I6d64f8fded7eb37cb7bf9b49bb750e66b1424f7b
-rw-r--r-- | plugins/org.eclipse.osee.framework.ui.branch.graph/src/org/eclipse/osee/framework/ui/branch/graph/model/GraphLoader.java | 11 |
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 00c400914d7..2d1a1df82e7 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); } |