commit f693bb54c1c23627a7538788c71487c943b384fe
parent 785d102e80ee20954f94781b1677973d22b0dbe6
Author: William Casarin <jb55@jb55.com>
Date: Wed, 18 Dec 2024 13:03:51 -0800
fix weird crash with missing timeline
My timeline wen't missing and then I started crashing here..
bizarre
Diffstat:
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/crates/notedeck_columns/src/route.rs b/crates/notedeck_columns/src/route.rs
@@ -66,10 +66,11 @@ impl Route {
match self {
Route::Timeline(tlr) => match tlr {
TimelineRoute::Timeline(id) => {
- let timeline = columns
- .find_timeline(*id)
- .expect("expected to find timeline");
- timeline.kind.to_title()
+ if let Some(timeline) = columns.find_timeline(*id) {
+ timeline.kind.to_title()
+ } else {
+ ColumnTitle::simple("Unknown")
+ }
}
TimelineRoute::Thread(_id) => ColumnTitle::simple("Thread"),
TimelineRoute::Reply(_id) => ColumnTitle::simple("Reply"),