diff options
author | Andrey Loskutov | 2016-12-26 21:33:55 +0000 |
---|---|---|
committer | Andrey Loskutov | 2016-12-26 21:33:55 +0000 |
commit | acf7dbc4372cdcaba614891dc02af49372f82610 (patch) | |
tree | 2406cea25a62d70ba21a690984e1e5492c964abc | |
parent | 0189eb975e89a5532be41a128ea2674dc620bd2a (diff) | |
download | eclipse.platform.team-I20161230-2000.tar.gz eclipse.platform.team-I20161230-2000.tar.xz eclipse.platform.team-I20161230-2000.zip |
Bug 509708 - Don't try to create an image from a null descriptor.I20170104-0800I20170103-2000I20170102-2000I20170101-2000I20161231-2000I20161230-2000I20161229-2000
Elements in the outline can be "virtual" without real direction of the
change (e.g. "Compilation Unit" root node). Such elements are created
from RangeDifferences with "NOCHANGE" kind (so the
DocumentMerger.Diff.fDirection is zero), and therefore they do not have
an image descriptor configured in CompareConfiguration.fgImages array.
Change-Id: I82645b097fe49a3d61e2e7934a0190a718a9ec35
Signed-off-by: Andrey Loskutov <loskutov@gmx.de>
-rw-r--r-- | bundles/org.eclipse.compare/compare/org/eclipse/compare/CompareConfiguration.java | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/CompareConfiguration.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/CompareConfiguration.java index 021451528..8337ad85a 100644 --- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/CompareConfiguration.java +++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/CompareConfiguration.java @@ -325,14 +325,20 @@ public class CompareConfiguration { * disposed when the <code>dispose</code> method is called. * * @param kind the kind of change as defined in <code>Differencer</code>. - * @return an modification of the base image reflecting the kind of change. + * @return an modification of the base image reflecting the kind of change + * or {@code null} if there is no image descriptor registered for + * given id. * @see org.eclipse.compare.structuremergeviewer.Differencer * @since 2.0 */ public Image getImage(int kind) { - if (fDisposed) + if (fDisposed) { return null; + } ImageDescriptor id= getImageDescriptor(kind); + if (id == null) { + return null; + } ResourceManager rm = getResourceManager(); return rm.createImage(id); } |