Skip to content

Commit

Permalink
Merge if's
Browse files Browse the repository at this point in the history
  • Loading branch information
axunonb committed Sep 18, 2024
1 parent b38d6f1 commit c79f0f5
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions Src/TournamentCalendar/Services/UserLocationService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,11 @@ 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.Latitude.HasValue || infoService.Longitude.HasValue))
{
if (infoService.Latitude.HasValue || infoService.Longitude.HasValue)
{
SetGeoLocation(infoService.Latitude.Value, infoService.Longitude.Value);
return;
}
SetGeoLocation(infoService.Latitude.Value, infoService.Longitude.Value);

Check warning on line 91 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 91 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 91 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 91 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 91 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 91 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 91 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 91 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 c79f0f5

Please sign in to comment.