From: Keith Packard Date: Mon, 29 Sep 2014 19:57:27 +0000 (-0700) Subject: altosui: Check for map and stats table when changing units/fonts in graph X-Git-Tag: bdale-altosdroid~16 X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=commitdiff_plain;h=95d9248da78f86240dbe77e2c206420dc509c9cf;ds=sidebyside 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 --- 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 {