Skip to content

Commit a8c880b

Browse files
committed
fix NullPointerException in Theme Selector (resolves #476)
1 parent 03baa46 commit a8c880b

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

app/src/processing/app/contrib/ManagerFrame.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -139,10 +139,14 @@ private void makeFrame() {
139139

140140

141141
protected void updateTheme() {
142-
Color bgColor = Theme.getColor("manager.tab.background");
143-
frame.getContentPane().setBackground(bgColor);
142+
// don't update if the Frame doesn't actually exist yet
143+
// https://github.com/processing/processing4/issues/476
144+
if (frame != null) {
145+
Color bgColor = Theme.getColor("manager.tab.background");
146+
frame.getContentPane().setBackground(bgColor);
144147

145-
tabs.updateTheme();
148+
tabs.updateTheme();
149+
}
146150
}
147151

148152

todo.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ X no longer pass a blank sketch file name from startup script
99
X also remove unused readlink
1010
X support multiple files passed on command line
1111
X only show setWritable() failure in recent.txt when it is a problem
12+
X NullPointerException when changing the theme
13+
X https://github.com/processing/processing4/issues/476
1214

1315
design
1416
X set minimum size for scroll bar thumb

0 commit comments

Comments
 (0)