mirror of
https://github.com/EFForg/rayhunter.git
synced 2026-04-26 23:49:59 -07:00
Fix crash when deleting recordings
Due to a refactor in https://github.com/EFForg/rayhunter/pull/350, we had to move more into the shared codepath of StopRecording. The todo!() used to be unreachable when it was just in the stop-recording endpoint. Fix #367
This commit is contained in:
committed by
Cooper Quintin
parent
f2b722ad5f
commit
8d8d2bd8ec
@@ -72,17 +72,14 @@ pub fn run_diag_read_thread(
|
||||
},
|
||||
Some(DiagDeviceCtrlMessage::StopRecording) => {
|
||||
let mut qmdl_store = qmdl_store_lock.write().await;
|
||||
match qmdl_store.get_current_entry() {
|
||||
Some((_, entry)) => {
|
||||
if let Err(e) = analysis_sender
|
||||
.send(AnalysisCtrlMessage::RecordingFinished(
|
||||
entry.name.to_string(),
|
||||
))
|
||||
.await {
|
||||
warn!("couldn't send analysis message: {}", e);
|
||||
}
|
||||
}
|
||||
None => todo!(),
|
||||
if let Some((_, entry)) = qmdl_store.get_current_entry() {
|
||||
if let Err(e) = analysis_sender
|
||||
.send(AnalysisCtrlMessage::RecordingFinished(
|
||||
entry.name.to_string(),
|
||||
))
|
||||
.await {
|
||||
warn!("couldn't send analysis message: {}", e);
|
||||
}
|
||||
}
|
||||
if let Err(e) = qmdl_store.close_current_entry().await {
|
||||
error!("couldn't close current entry: {}", e);
|
||||
|
||||
Reference in New Issue
Block a user