aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJens Baumgart2010-08-11 13:13:21 -0400
committerJens Baumgart2010-08-11 13:13:21 -0400
commit5ed46eeed3b15ce8eca4b00651a7411b372639ec (patch)
tree354301f104b54ff7bec74ba1a65a15412ac86367
parent96faaecf12d7e42fb2058b583472b4b733e08594 (diff)
downloadegit-5ed46eeed3b15ce8eca4b00651a7411b372639ec.zip
egit-5ed46eeed3b15ce8eca4b00651a7411b372639ec.tar.gz
egit-5ed46eeed3b15ce8eca4b00651a7411b372639ec.tar.xz
Make PropertyTester more robust
PropertyTester fails with NPE when the underlying repository is corrupted. Lots of error popups are shown to the user and the user cannot remove the corrupted repository from RepositoriesView. Bug: 318535 Change-Id: Idbe3e064e3746791d4880e17281e241fd63eea7f Signed-off-by: Jens Baumgart <jens.baumgart@sap.com>
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/PropertyTester.java5
1 files changed, 4 insertions, 1 deletions
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/PropertyTester.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/PropertyTester.java
index e6bbca1..f6115ea 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/PropertyTester.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/PropertyTester.java
@@ -92,7 +92,10 @@ public class PropertyTester extends org.eclipse.core.expressions.PropertyTester
if (property.equals("canMerge")) { //$NON-NLS-1$
Repository rep = node.getRepository();
try {
- return rep.getFullBranch().startsWith(Constants.R_HEADS);
+ String branch = rep.getFullBranch();
+ if (branch == null)
+ return false; // fail gracefully...
+ return branch.startsWith(Constants.R_HEADS);
} catch (IOException e) {
return false;
}