Skip to content

Commit

Permalink
fix bug where null exp gives 2023 years (#188)
Browse files Browse the repository at this point in the history
  • Loading branch information
jonasbjoralt authored Oct 25, 2023
1 parent 423ffcf commit b284251
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion backend/Api/Consultants/ConsultantExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ public static ConsultantReadModel MapConsultantToReadModel(this Consultant consu
{
const double tolerance = 0.1;
var currentYear = DateTime.Now.Year;
var yearsOfExperience = currentYear - consultant.GraduationYear ?? currentYear;
var yearsOfExperience =
currentYear - (consultant.GraduationYear is null or 0 ? currentYear : consultant.GraduationYear) ?? 0;

var bookedHours = GetBookedHoursForWeeks(consultant, weeks);

Expand Down

0 comments on commit b284251

Please sign in to comment.