Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTorbjörn Svensson2022-04-17 12:24:45 +0000
committerTorbjörn Svensson2022-04-17 21:27:24 +0000
commit96d8c32368408e2ec1146a79df1283de5b5f195c (patch)
treee1ab684669e40be1c0603b92c31f771b0f353195
parent5e5373982feda5babae338d9d2cde00105be6ae1 (diff)
downloadorg.eclipse.cdt-96d8c32368408e2ec1146a79df1283de5b5f195c.tar.gz
org.eclipse.cdt-96d8c32368408e2ec1146a79df1283de5b5f195c.tar.xz
org.eclipse.cdt-96d8c32368408e2ec1146a79df1283de5b5f195c.zip
Prevent NPE in property change callback
Contributed by STMicroelectronics Change-Id: I7be0660541bfe85cd0c371eddeb7ef14eb2fe75d Signed-off-by: Torbjörn Svensson <torbjorn.svensson@st.com>
-rw-r--r--core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/buildconsole/BuildConsolePage.java4
1 files changed, 3 insertions, 1 deletions
diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/buildconsole/BuildConsolePage.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/buildconsole/BuildConsolePage.java
index 01d3561bee2..7294300c5c7 100644
--- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/buildconsole/BuildConsolePage.java
+++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/buildconsole/BuildConsolePage.java
@@ -259,7 +259,9 @@ public class BuildConsolePage extends Page
setTabs(CUIPlugin.getDefault().getPreferenceStore()
.getInt(BuildConsolePreferencePage.PREF_BUILDCONSOLE_TAB_WIDTH));
} else if (IConsoleConstants.P_BACKGROUND_COLOR.equals(property)) {
- fViewer.getTextWidget().setBackground(fConsole.getBackground());
+ if (fViewer != null && fViewer.getTextWidget() != null && fConsole != null) {
+ fViewer.getTextWidget().setBackground(fConsole.getBackground());
+ }
} else if (property.equals(BuildConsolePreferencePage.PREF_BUILDCONSOLE_WRAP_LINES)
|| property.equals(BuildConsolePreferencePage.PREF_BUILDCONSOLE_LINES)
|| property.equals(BuildConsolePreferencePage.PREF_BUILDCONSOLE_WRAP_LINES_MAX)) {

Back to the top