Description field can be null (fix crash #33)

This commit is contained in:
w1nst0n 2021-09-30 14:50:34 +02:00
commit e4dd4fced6
No known key found for this signature in database
GPG key ID: 34D27465928A0A1D
3 changed files with 179 additions and 171 deletions

View file

@ -10,6 +10,11 @@ and `Removed`.
## [Unreleased]
## [0.2.2] - 2021-09-30
## Fixed
- Crash when conecting a LG device (#33)
## [0.2.1] - 2021-09-28
## Added

File diff suppressed because it is too large Load diff

View file

@ -102,7 +102,10 @@ impl List {
removal = Removal::Unlisted;
if uad_lists.contains_key(p_name) {
description = uad_lists.get(p_name).unwrap().description.as_ref().unwrap();
description = match &uad_lists.get(p_name).unwrap().description {
Some(descr) => &descr,
None => "[No description]",
};
uad_list = uad_lists.get(p_name).unwrap().list;
removal = uad_lists.get(p_name).unwrap().removal;
}