mirror of
https://github.com/zjs81/meshcore-open.git
synced 2026-07-27 05:56:39 +10:00
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:
@@ -87,7 +87,7 @@ Contact? getRepeaterPrefixMatchNearLocation(
|
|||||||
var bestDistance = double.infinity;
|
var bestDistance = double.infinity;
|
||||||
|
|
||||||
for (final c in candidates) {
|
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!));
|
final d = distance(searchPoint, LatLng(c.latitude!, c.longitude!));
|
||||||
if (d < bestDistance) {
|
if (d < bestDistance) {
|
||||||
bestDistance = d;
|
bestDistance = d;
|
||||||
|
|||||||
Reference in New Issue
Block a user