codex suggested fix: explicit check if contact location is not null

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
ericszimmermann 2026-03-15 12:10:47 +01:00 committed by GitHub
parent 3664ae34cd
commit 0ef2194fb0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -87,7 +87,7 @@ Contact? getRepeaterPrefixMatchNearLocation(
var bestDistance = double.infinity;
for (final c in candidates) {
if (c.hasLocation) {
if (c.hasLocation && c.latitude != null && c.longitude != null) {
final d = distance(searchPoint, LatLng(c.latitude!, c.longitude!));
if (d < bestDistance) {
bestDistance = d;