diff options
author | Matthias Becker | 2018-03-15 13:46:19 +0000 |
---|---|---|
committer | Matthias Becker | 2018-03-16 07:29:29 +0000 |
commit | 8b3283fcaa569f10301c31aba2924893a8a36446 (patch) | |
tree | a5c720c6bad948b7f36c643d11eb6883a2e67dce | |
parent | bb666d8b3569e888e6ba3e767a1352ef81cec3db (diff) | |
download | eclipse.platform.text-8b3283fcaa569f10301c31aba2924893a8a36446.tar.gz eclipse.platform.text-8b3283fcaa569f10301c31aba2924893a8a36446.tar.xz eclipse.platform.text-8b3283fcaa569f10301c31aba2924893a8a36446.zip |
Bug 517393: Dark theme hyper-link text is dark blue
Fix NPE in non-IDE use case
Change-Id: Iae0e2397781e7ee08a0ce0312af4f3f539617858
Signed-off-by: Matthias Becker <ma.becker@sap.com>
-rw-r--r-- | org.eclipse.jface.text/src/org/eclipse/jface/internal/text/html/HTMLPrinter.java | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/org.eclipse.jface.text/src/org/eclipse/jface/internal/text/html/HTMLPrinter.java b/org.eclipse.jface.text/src/org/eclipse/jface/internal/text/html/HTMLPrinter.java index afd745a5f92..c04e83112c1 100644 --- a/org.eclipse.jface.text/src/org/eclipse/jface/internal/text/html/HTMLPrinter.java +++ b/org.eclipse.jface.text/src/org/eclipse/jface/internal/text/html/HTMLPrinter.java @@ -16,6 +16,7 @@ import java.net.URL; import org.eclipse.swt.SWT; import org.eclipse.swt.SWTError; +import org.eclipse.swt.graphics.Color; import org.eclipse.swt.graphics.FontData; import org.eclipse.swt.graphics.RGB; import org.eclipse.swt.widgets.Display; @@ -69,8 +70,14 @@ public class HTMLPrinter { private static void cacheColors(Display display) { BG_COLOR_RGB= JFaceColors.getInformationViewerBackgroundColor(display).getRGB(); FG_COLOR_RGB= JFaceColors.getInformationViewerForegroundColor(display).getRGB(); - LINK_COLOR_RGB= JFaceColors.getHyperlinkText(display).getRGB(); - ACTIVE_LINK_COLOR_RGB= JFaceColors.getActiveHyperlinkText(display).getRGB(); + Color hyperlinkText= JFaceColors.getHyperlinkText(display); + if (hyperlinkText != null) { + LINK_COLOR_RGB= hyperlinkText.getRGB(); + } + Color activeHyperlinkText= JFaceColors.getActiveHyperlinkText(display); + if (activeHyperlinkText != null) { + ACTIVE_LINK_COLOR_RGB= activeHyperlinkText.getRGB(); + } } private static void installColorUpdater(final Display display) { |