Skip to content

Commit

Permalink
- no didvidend data error prpagated
Browse files Browse the repository at this point in the history
  • Loading branch information
jczaja committed May 5, 2024
1 parent d020681 commit 1f7af87
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -365,12 +365,12 @@ async fn get_dividiend_data(
cash_amount,
NaiveDate::parse_from_str(&pay_date, "%Y-%m-%d").expect("Wrong payout date format"),
),
None => panic!("No dividend Data!"),
None => return Err("No dividend Data!"),
};
let currency = if resp.results.len() > 0 {
resp.results[0].currency.clone()
} else {
panic!("No dividend Data!");
return Err("No dividend Data!");
};

let dgr = calculate_dgr(&div_history, Utc::now().year().to_string().as_ref())?;
Expand Down

0 comments on commit 1f7af87

Please sign in to comment.