Skip to content

Commit

Permalink
fix: create java values before throwing exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
Apehum committed Nov 22, 2023
1 parent 9d72262 commit b2e9e28
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion rust/src/denoise.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,12 @@ pub unsafe extern "system" fn Java_com_plasmoverse_rnnoise_Denoise_processNative
match denoise_process(&mut env, denoise, samples) {
Ok(processed) => processed,
Err(exception) => {
let result = env.new_float_array(0)
.expect("Couldn't create java float array");

env.throw_new_exception(exception);
env.new_float_array(0).expect("") // todo: ???

result
}
}
}
Expand Down

0 comments on commit b2e9e28

Please sign in to comment.