mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
Fix None dereferences in weather UI.
Also normalizes line endings.
This commit is contained in:
parent
afabf6fd00
commit
75ea5cc462
@ -183,8 +183,13 @@ class QWeatherWidget(QGroupBox):
|
|||||||
"""Updates the Forecast Text and icon with the current conditions wind info.
|
"""Updates the Forecast Text and icon with the current conditions wind info.
|
||||||
"""
|
"""
|
||||||
icon = []
|
icon = []
|
||||||
cloudDensity = self.conditions.weather.clouds.density or 0
|
if self.conditions.weather.clouds is None:
|
||||||
precipitation = self.conditions.weather.clouds.precipitation or None
|
cloudDensity = 0
|
||||||
|
precipitation = None
|
||||||
|
else:
|
||||||
|
cloudDensity = self.conditions.weather.clouds.density
|
||||||
|
precipitation = self.conditions.weather.clouds.precipitation
|
||||||
|
|
||||||
fog = self.conditions.weather.fog or None
|
fog = self.conditions.weather.fog or None
|
||||||
is_night = self.conditions.time_of_day == TimeOfDay.Night
|
is_night = self.conditions.time_of_day == TimeOfDay.Night
|
||||||
time = 'night' if is_night else 'day'
|
time = 'night' if is_night else 'day'
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user