about summary refs log tree commit diff
path: root/src/frontend/templates
diff options
context:
space:
mode:
Diffstat (limited to 'src/frontend/templates')
-rw-r--r--src/frontend/templates/mod.rs8
-rw-r--r--src/frontend/templates/onboarding.rs1
2 files changed, 4 insertions, 5 deletions
diff --git a/src/frontend/templates/mod.rs b/src/frontend/templates/mod.rs
index 3585804..100e16d 100644
--- a/src/frontend/templates/mod.rs
+++ b/src/frontend/templates/mod.rs
@@ -165,9 +165,9 @@ markup::define! {
                                             }
                                         } else {
                                             // This is a rich food object (mm, sounds tasty! I wanna eat something tasty)
-                                            a."u-ate"[href=food["properties"]["uid"][0].as_str().unwrap()] {
+                                            a."u-ate"[href=food["properties"]["uid"][0].as_str().unwrap_or("#")] {
                                                 @food["properties"]["name"][0].as_str()
-                                                    .unwrap_or(food["properties"]["uid"][0].as_str().unwrap().truncate_ellipse(24).as_ref())
+                                                    .unwrap_or(food["properties"]["uid"][0].as_str().unwrap_or("#").truncate_ellipse(24).as_ref())
                                             }
                                         }
                                     }
@@ -186,9 +186,9 @@ markup::define! {
                                             }
                                         } else {
                                             // This is a rich food object (mm, sounds tasty! I wanna eat something tasty)
-                                            a."u-drank"[href=food["properties"]["uid"][0].as_str().unwrap()] {
+                                            a."u-drank"[href=food["properties"]["uid"][0].as_str().unwrap_or("#")] {
                                                 @food["properties"]["name"][0].as_str()
-                                                    .unwrap_or(food["properties"]["uid"][0].as_str().unwrap().truncate_ellipse(24).as_ref())
+                                                    .unwrap_or(food["properties"]["uid"][0].as_str().unwrap_or("#").truncate_ellipse(24).as_ref())
                                             }
                                         }
                                     }
diff --git a/src/frontend/templates/onboarding.rs b/src/frontend/templates/onboarding.rs
index aab2b31..ebf8881 100644
--- a/src/frontend/templates/onboarding.rs
+++ b/src/frontend/templates/onboarding.rs
@@ -190,4 +190,3 @@ markup::define! {
         }
     }
 }
-