Handle incomplete lat/long values

This commit is contained in:
Neeraj Gupta 2023-04-19 08:25:00 +05:30
parent 416fc58053
commit bdb853ebd6
No known key found for this signature in database
GPG key ID: 3C5A1684DC1729E1

View file

@ -209,6 +209,9 @@ class GPSData {
if (lat == null || long == null) {
return null;
}
if (lat!.length < 3 || long!.length < 3) {
return null;
}
final latSign = (latRef ?? 'N') == "N" ? 1 : -1;
final longSign = (longRef ?? 'E') == "E" ? 1 : -1;
return Location(