Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLaurent Delaigue2015-06-04 05:28:31 -0400
committerMatthias Sohn2015-06-08 11:28:15 -0400
commit3279d387cb59c0a641c7064ba107de3fdb0f070c (patch)
tree20fe5ab09a5cd8138ffe19d13b8dc6f110e7016f
parent2197b2091b94ad72ef772ca658171d4779ac8574 (diff)
downloadegit-3279d387cb59c0a641c7064ba107de3fdb0f070c.tar.gz
egit-3279d387cb59c0a641c7064ba107de3fdb0f070c.tar.xz
egit-3279d387cb59c0a641c7064ba107de3fdb0f070c.zip
Fixes potential NPE in CompareTreeView.
getRepoRelativePath() can return null in certain scenarios, in which case there's a NullPointerException with the former implementation. Change-Id: I9aa21be4302df8a98a4cb6936962c14981a130f1 Signed-off-by: Laurent Delaigue <laurent.delaigue@obeo.fr> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/CompareTreeView.java3
1 files changed, 2 insertions, 1 deletions
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/CompareTreeView.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/CompareTreeView.java
index 8c8dcb814..51a5fb92a 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/CompareTreeView.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/CompareTreeView.java
@@ -556,8 +556,9 @@ public class CompareTreeView extends ViewPart implements IMenuListener, IShowInS
for (IResource resource : resources) {
String relPath = repositoryMapping
.getRepoRelativePath(resource);
- if (relPath.length() > 0)
+ if (relPath != null && relPath.length() > 0) {
orFilters.add(PathFilter.create(relPath));
+ }
}
if (checkIgnored) {
if (orFilters.size() > 1) {

Back to the top