feat: Add location validation and improve contact latitude/longitude handling

This commit is contained in:
Winston Lowe 2026-03-21 09:39:03 -07:00
parent e313bea3fc
commit 4f609f160f
2 changed files with 23 additions and 20 deletions

View file

@ -181,12 +181,13 @@ class Contact {
final lastMod = reader.readUInt32LE();
double? lat, lon;
final latRaw = reader.readInt32LE();
final lonRaw = reader.readInt32LE();
if (latRaw != 0 || lonRaw != 0) {
lat = latRaw / 1e6;
lon = lonRaw / 1e6;
if (reader.remaining >= 8) {
final latRaw = reader.readInt32LE();
final lonRaw = reader.readInt32LE();
if (latRaw != 0 || lonRaw != 0) {
lat = latRaw / 1e6;
lon = lonRaw / 1e6;
}
}
return Contact(