summaryrefslogtreecommitdiffstats
path: root/examples/comprehensive
diff options
context:
space:
mode:
Diffstat (limited to 'examples/comprehensive')
-rw-r--r--examples/comprehensive9
1 files changed, 5 insertions, 4 deletions
diff --git a/examples/comprehensive b/examples/comprehensive
index 580d0bf..7510744 100644
--- a/examples/comprehensive
+++ b/examples/comprehensive
@@ -395,10 +395,11 @@ def periodically(year, month, day, hour, minute, second, weekday, fade):
for condition in conditions:
if condition in weather_modifiers:
dayness *= weather_modifiers[condition]
- _bound, visibility = metar[1]
- if (visibility_max is not None) and (visibility is not None):
- if visibility < visibility_max:
- dayness *= visibility / visibility_max
+ if metar[1] is not None:
+ (_bound, visibility) = metar[1]
+ if (visibility_max is not None) and (visibility is not None):
+ if visibility < visibility_max:
+ dayness *= visibility / visibility_max
# Do not do unnecessary work.
if fade is None: