diff --git a/src/model/user.rs b/src/model/user.rs index b940ff1..a018d3f 100644 --- a/src/model/user.rs +++ b/src/model/user.rs @@ -362,10 +362,14 @@ ASKÖ Ruderverein Donau Linz", self.name), } let halfprice = if let Some(member_since_date) = &self.member_since_date { - let member_since_date = - NaiveDate::parse_from_str(member_since_date, "%Y-%m-%d").unwrap(); - let halfprice_startdate = NaiveDate::from_ymd_opt(Local::now().year(), 7, 1).unwrap(); - member_since_date >= halfprice_startdate + if let Ok(member_since_date) = NaiveDate::parse_from_str(member_since_date, "%Y-%m-%d") + { + let halfprice_startdate = + NaiveDate::from_ymd_opt(Local::now().year(), 7, 1).unwrap(); + member_since_date >= halfprice_startdate + } else { + false + } } else { false };