PB: fix null
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
nyyu 2021-05-10 10:20:31 +02:00
parent f0ab2e9530
commit eb4b238256

View file

@ -15,8 +15,7 @@ struct ChampionResponse {
#[derive(Deserialize, Debug)] #[derive(Deserialize, Debug)]
struct Champion { struct Champion {
key: String, key: Option<String>,
name: String,
} }
impl DataSource for PBDataSource { impl DataSource for PBDataSource {
@ -42,7 +41,9 @@ impl DataSource for PBDataSource {
let data: ChampionResponse = serde_json::from_str(&page).unwrap(); let data: ChampionResponse = serde_json::from_str(&page).unwrap();
for champ in data.champions { for champ in data.champions {
champs.insert(champ.key.parse::<u32>().unwrap(), vec!["ANY".to_owned()]); if let Some(k) = champ.key {
champs.insert(k.parse::<u32>().unwrap(), vec!["ANY".to_owned()]);
}
} }
champs champs