Skip to content

Commit

Permalink
Fix nullability issue in UserLocationService
Browse files Browse the repository at this point in the history
  • Loading branch information
axunonb committed Sep 18, 2024
1 parent ac2084d commit b38d6f1
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Src/TournamentCalendar/Services/UserLocationService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,11 @@ public void SetFromUserGuid(Guid userGuid)
var infoService = new InfoServiceEntity();
if (_appDb.InfoServiceRepository.GetRegistrationByGuid(infoService, userGuid.ToString("N")))
{
SetGeoLocation(infoService.Latitude.Value, infoService.Longitude.Value);
return;
if (infoService.Latitude.HasValue || infoService.Longitude.HasValue)
{
SetGeoLocation(infoService.Latitude.Value, infoService.Longitude.Value);

Check warning on line 92 in Src/TournamentCalendar/Services/UserLocationService.cs

View workflow job for this annotation

GitHub Actions / build

Nullable value type may be null.

Check warning on line 92 in Src/TournamentCalendar/Services/UserLocationService.cs

View workflow job for this annotation

GitHub Actions / build

Nullable value type may be null.

Check warning on line 92 in Src/TournamentCalendar/Services/UserLocationService.cs

View workflow job for this annotation

GitHub Actions / build

Nullable value type may be null.

Check warning on line 92 in Src/TournamentCalendar/Services/UserLocationService.cs

View workflow job for this annotation

GitHub Actions / build

Nullable value type may be null.
return;
}
}

ClearGeoLocation();
Expand Down

0 comments on commit b38d6f1

Please sign in to comment.