From 95d9248da78f86240dbe77e2c206420dc509c9cf Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Mon, 29 Sep 2014 12:57:27 -0700 Subject: [PATCH] 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 --- altosui/AltosGraphUI.java | 9 ++++++--- 1 file 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 { -- 2.30.2