diff options
author | Keith Packard <keithp@keithp.com> | 2014-09-29 12:57:27 -0700 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2014-09-29 12:57:27 -0700 |
commit | 95d9248da78f86240dbe77e2c206420dc509c9cf (patch) | |
tree | ac9a483297084fb9251d9a7c08f7f3eb91d335d8 /altosui/AltosGraphUI.java | |
parent | 40c5535b65a75374fb1dbbd994c29324db814f5b (diff) |
altosui: Check for map and stats table when changing units/fonts in graph
AltosGraphUI wasn't making sure the map and stats tables were present
before attempting to adjust font size and units.
Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'altosui/AltosGraphUI.java')
-rw-r--r-- | altosui/AltosGraphUI.java | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/altosui/AltosGraphUI.java b/altosui/AltosGraphUI.java index ddd281a6..2d00fb45 100644 --- a/altosui/AltosGraphUI.java +++ b/altosui/AltosGraphUI.java @@ -55,12 +55,15 @@ public class AltosGraphUI extends AltosUIFrame implements AltosFontListener, Alt } public void font_size_changed(int font_size) { - map.font_size_changed(font_size); - statsTable.font_size_changed(font_size); + if (map != null) + map.font_size_changed(font_size); + if (statsTable != null) + statsTable.font_size_changed(font_size); } public void units_changed(boolean imperial_units) { - map.units_changed(imperial_units); + if (map != null) + map.units_changed(imperial_units); } AltosGraphUI(AltosStateIterable states, File file) throws InterruptedException, IOException { |