aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit/src/org/eclipse/jgit
diff options
context:
space:
mode:
authorMatthias Sohn <matthias.sohn@sap.com>2024-12-04 11:19:39 +0100
committerMatthias Sohn <matthias.sohn@sap.com>2024-12-05 01:51:42 +0100
commit7f246a05dcbf11a6c9dcd21215f38f62ad801866 (patch)
treef0ec5b38a578add8de7418e4356ceb84cf13485b /org.eclipse.jgit/src/org/eclipse/jgit
parentf2741cacec9f46724a0e48cc55cbb8892361e3d0 (diff)
downloadjgit-7f246a05dcbf11a6c9dcd21215f38f62ad801866.tar.gz
jgit-7f246a05dcbf11a6c9dcd21215f38f62ad801866.zip
Fix potential NPE in ResolveMerger#getAttributesContentMergeStrategy
Change-Id: I2a4c57438c16a0c5bc1af4c7772eaf65049911e2
Diffstat (limited to 'org.eclipse.jgit/src/org/eclipse/jgit')
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/merge/ResolveMerger.java9
1 files changed, 6 insertions, 3 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/merge/ResolveMerger.java b/org.eclipse.jgit/src/org/eclipse/jgit/merge/ResolveMerger.java
index a6a287bcf4..a50a6440b9 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/merge/ResolveMerger.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/merge/ResolveMerger.java
@@ -1507,9 +1507,12 @@ public class ResolveMerger extends ThreeWayMerger {
private ContentMergeStrategy getAttributesContentMergeStrategy(
Attributes attributes, ContentMergeStrategy strategy) {
Attribute attr = attributes.get(Constants.ATTR_MERGE);
- if (attr != null && attr.getValue()
- .equals(Constants.ATTR_BUILTIN_UNION_MERGE_DRIVER)) {
- return ContentMergeStrategy.UNION;
+ if (attr != null) {
+ String attrValue = attr.getValue();
+ if (attrValue != null && attrValue
+ .equals(Constants.ATTR_BUILTIN_UNION_MERGE_DRIVER)) {
+ return ContentMergeStrategy.UNION;
+ }
}
return strategy;
}