trees: fix pfaf getting

This commit is contained in:
Astro 2021-08-26 15:43:24 +02:00
parent 0364650831
commit a29d2e6be0
1 changed files with 3 additions and 1 deletions

View File

@ -87,7 +87,9 @@ pub fn get_tree(state: State) -> (State, Response<Body>) {
let point: Point<f64> = row.get(1);
let mut details: HashMap<String, String> = HashMap::with_capacity(PFAF_COLS.len());
for (i, col) in PFAF_COLS.iter().enumerate() {
details.insert(col.to_string(), pfaf_row.get(i));
if let Some(value) = pfaf_row.get(i) {
details.insert(col.to_string(), value);
}
}
Tree {
id: row.get(0),