diff --git a/src/bar_modules/bar_module_weather.rs b/src/bar_modules/bar_module_weather.rs index 1572bb0..62f9f57 100644 --- a/src/bar_modules/bar_module_weather.rs +++ b/src/bar_modules/bar_module_weather.rs @@ -251,9 +251,16 @@ impl bar_modules::BarModuleActions for UnibarModuleWeather { // "icon": "https://api.weather.gov/icons/land/night/ovc?size=medium", let re = Regex::new(r"(\w+)\?size").unwrap(); let json_val = self.weather_info["features"][0]["properties"]["icon"].to_string(); - let caps = re.captures(&json_val).unwrap(); + match self.weather_info["features"][0]["properties"]["icon"] { + serde_json::Value::Null => { + return "⁈".to_string(); + } + _ => { + let caps = re.captures(&json_val).unwrap(); - return self.get_unicode_symbol(caps.get(1).unwrap().as_str()); + return self.get_unicode_symbol(caps.get(1).unwrap().as_str()); + } + } } } }