Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

Handle invalid coordinates in location grouping

Neeraj Gupta13ff39d69abe
diff --git a/mobile/apps/photos/changes/location-search.md b/mobile/apps/photos/changes/location-search.md
new file mode 100644
index 0000000000..065d55d3a2
--- /dev/null
+++ b/mobile/apps/photos/changes/location-search.md
@@ -0,0 +1 @@
+- Added country-name search and improved city matching for locations and memories.
diff --git a/rust/crates/location/src/lib.rs b/rust/crates/location/src/lib.rs
index 1fa2202830..8b4f69de7b 100644
--- a/rust/crates/location/src/lib.rs
+++ b/rust/crates/location/src/lib.rs
@@ -131,8 +131,15 @@ impl CountryIndex {
let mut unclassified_coordinate_indices = Vec::new();
for (coordinate_index, &coordinate) in coordinates.iter().enumerate() {
- let classification = self.lookup(coordinate)?;
let coordinate_index = coordinate_index as u32;
+ let classification = match self.lookup(coordinate) {
+ Ok(classification) => classification,
+ Err(Error::InvalidCoordinate) => {
+ unclassified_coordinate_indices.push(coordinate_index);
+ continue;
+ }
+ Err(error) => return Err(error),
+ };
if classification.disputes.is_empty() {
if classification.countries.is_empty() {
unclassified_coordinate_indices.push(coordinate_index);