diff --git a/CHANGELOG.md b/CHANGELOG.md index 018a2a0..40a32d2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed - Ensure logir is not null +- Fixed index out of bounds caused by olded ts ### Added diff --git a/src/main.rs b/src/main.rs index d5f77ca..94156dd 100644 --- a/src/main.rs +++ b/src/main.rs @@ -238,6 +238,9 @@ async fn get_pkg_log( ) .await .unwrap(); + if rows.len() == 0 { + return HttpResponse::BadRequest().body("ts is too old"); + } let logdir: String = rows[0].get("logdir"); let filename = format!("/home/lilydjwg/.lilac/log/{}/{}.log", logdir, name); let contents = match std::fs::read_to_string(&filename) {