From a8c880b8b8a5157eae053be62b31b2c3a3b217aa Mon Sep 17 00:00:00 2001 From: Ben Fry Date: Sat, 23 Apr 2022 06:27:36 -0400 Subject: [PATCH] fix NullPointerException in Theme Selector (resolves #476) --- app/src/processing/app/contrib/ManagerFrame.java | 10 +++++++--- todo.txt | 2 ++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/app/src/processing/app/contrib/ManagerFrame.java b/app/src/processing/app/contrib/ManagerFrame.java index 876c60f93..61c8b4201 100644 --- a/app/src/processing/app/contrib/ManagerFrame.java +++ b/app/src/processing/app/contrib/ManagerFrame.java @@ -139,10 +139,14 @@ public class ManagerFrame { protected void updateTheme() { - Color bgColor = Theme.getColor("manager.tab.background"); - frame.getContentPane().setBackground(bgColor); + // don't update if the Frame doesn't actually exist yet + // https://github.com/processing/processing4/issues/476 + if (frame != null) { + Color bgColor = Theme.getColor("manager.tab.background"); + frame.getContentPane().setBackground(bgColor); - tabs.updateTheme(); + tabs.updateTheme(); + } } diff --git a/todo.txt b/todo.txt index db7d15d5e..68f86b1fd 100755 --- a/todo.txt +++ b/todo.txt @@ -9,6 +9,8 @@ X no longer pass a blank sketch file name from startup script X also remove unused readlink X support multiple files passed on command line X only show setWritable() failure in recent.txt when it is a problem +X NullPointerException when changing the theme +X https://github.com/processing/processing4/issues/476 design X set minimum size for scroll bar thumb