Skip to content

Commit

Permalink
Fix nullability issue in UserLocationService (#95)
Browse files Browse the repository at this point in the history
* Fix nullability issue in `UserLocationService`
  • Loading branch information
axunonb authored Sep 18, 2024
1 parent ac2084d commit cd7d7fa
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Src/TournamentCalendar/Services/UserLocationService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,8 @@ public void ClearGeoLocation()
public void SetFromUserGuid(Guid userGuid)
{
var infoService = new InfoServiceEntity();
if (_appDb.InfoServiceRepository.GetRegistrationByGuid(infoService, userGuid.ToString("N")))
if (_appDb.InfoServiceRepository.GetRegistrationByGuid(infoService, userGuid.ToString("N")) &&
infoService is { Latitude: not null, Longitude: not null })
{
SetGeoLocation(infoService.Latitude.Value, infoService.Longitude.Value);
return;
Expand Down

0 comments on commit cd7d7fa

Please sign in to comment.