Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMalgorzata Janczarska2011-10-21 17:12:11 +0000
committerTomasz Zarna2011-10-21 17:12:11 +0000
commit72e049524fb42f6dcc2f3d8af5c27231b8089c37 (patch)
treececa59a44f9e2c4b4df0e8c1fd67c59d5c0ad9dc /bundles/org.eclipse.team.ui/src/org/eclipse
parent33f3884b44162a4fc6b1236e969d2804dcd07c28 (diff)
downloadeclipse.platform.team-72e049524fb42f6dcc2f3d8af5c27231b8089c37.tar.gz
eclipse.platform.team-72e049524fb42f6dcc2f3d8af5c27231b8089c37.tar.xz
eclipse.platform.team-72e049524fb42f6dcc2f3d8af5c27231b8089c37.zip
bug 347557: [Edit] NPE when saving a file in a compare editor (always)I20111024-1300
A fix for the case founded by Dani when one part of the comparison is empty e.g. after adding a new file.
Diffstat (limited to 'bundles/org.eclipse.team.ui/src/org/eclipse')
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/LocalResourceSaveableComparison.java9
1 files changed, 5 insertions, 4 deletions
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/LocalResourceSaveableComparison.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/LocalResourceSaveableComparison.java
index fb839b445..afa44be74 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/LocalResourceSaveableComparison.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/LocalResourceSaveableComparison.java
@@ -248,10 +248,10 @@ public abstract class LocalResourceSaveableComparison extends SaveableComparison
*/
public String getName() {
// Return the name of the file element as held in the compare input
- if (input.getLeft().equals(fileElement)) {
+ if (input.getLeft() != null && input.getLeft().equals(fileElement)) {
return input.getLeft().getName();
}
- if (input.getRight().equals(fileElement)) {
+ if (input.getRight() != null && input.getRight().equals(fileElement)) {
return input.getRight().getName();
}
// Fallback call returning name of the main non-null element of the input
@@ -289,14 +289,15 @@ public abstract class LocalResourceSaveableComparison extends SaveableComparison
ContentMergeViewer cmv = (ContentMergeViewer) e.getSource();
- if (input.getLeft().equals(fileElement)) {
+ if (input.getLeft() != null && input.getLeft().equals(fileElement)) {
if (changed && cmv.internalIsLeftDirty())
setDirty(changed);
else if (!changed && !cmv.internalIsLeftDirty()) {
setDirty(changed);
}
}
- if (input.getRight().equals(fileElement)) {
+ if (input.getRight() != null
+ && input.getRight().equals(fileElement)) {
if (changed && cmv.internalIsRightDirty())
setDirty(changed);
else if (!changed && !cmv.internalIsRightDirty()) {

Back to the top