# HG changeset patch # User Matti Hamalainen # Date 1443267533 -10800 # Node ID 088bb2621595dcd36f54a42a9698a009e7f9b65a # Parent 9cecab5a086201e3968f7516601c0f0baf97d749 weather: Do not attempt to access weather data through unset / invalid min/max temp keys. diff -r 9cecab5a0862 -r 088bb2621595 weather.tcl --- a/weather.tcl Thu Aug 27 13:04:13 2015 +0300 +++ b/weather.tcl Sat Sep 26 14:38:53 2015 +0300 @@ -223,9 +223,14 @@ } close $ufile - # Store min/max - set weather_data(w_min) $weather_data($wtemp_min_key) - set weather_data(w_max) $weather_data($wtemp_max_key) + # Store min/max + if {$wtemp_min_key != "" && $wtemp_max_key != ""} { + set weather_data(w_min) $weather_data($wtemp_min_key) + set weather_data(w_max) $weather_data($wtemp_max_key) + } else { + set weather_data(w_min) 0 + set weather_data(w_max) 0 + } } else { weather_log "Could not open data file: $uerrmsg" }