mirror of
https://github.com/BioArchLinux/bioarchlinux-packages.git
synced 2025-03-10 06:24:00 +00:00
fix: fixed logdir index out of bounds
This commit is contained in:
parent
6c96967407
commit
e3e428ad06
2 changed files with 4 additions and 0 deletions
|
@ -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
|
||||
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Add table
Reference in a new issue