fixed bug hayabusa crashes when level is not valid (#562)

* fixed undefined level unwarp panic bug #560

* updated changelog #560
This commit is contained in:
DustInDark
2022-06-03 11:55:22 +09:00
committed by GitHub
parent 2dcf960d51
commit 39468d3b06
3 changed files with 3 additions and 2 deletions

View File

@@ -21,6 +21,7 @@
**バグ修正:**
- `--start-timeline``--end-timeline`オプションが動かなかったのを修正した。 (#546) (@hitenkoku)
- ルール内の`level`が正しくない場合に検知数が最も多い日の集計の際にcrashが起きるのを修正した。 (#560) (@hitenkoku)
## v1.2.2 [2022/05/20]

View File

@@ -21,7 +21,7 @@
**Bug Fixes:**
- Fixed the `--start-timeline` and `--end-timeline` options as they were not working. (#546) @hitenkoku)
- Fixed crash bug when level in rule is not valid. (#560) (@hitenkoku)
## v1.2.2 [2022/05/20]

View File

@@ -294,7 +294,7 @@ fn emit_csv<W: std::io::Write>(
let time_str_date = &time_str[0..10];
let mut detect_counts_by_date = detect_counts_by_date_and_level
.get(&detect_info.level.to_lowercase())
.unwrap()
.unwrap_or_else(|| detect_counts_by_date_and_level.get("undefined").unwrap())
.clone();
*detect_counts_by_date
.entry(time_str_date.to_string())