diff --git a/CHANGELOG.md b/CHANGELOG.md index 0b63c2c..d70f4ea 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Use Create, Modify and Remove events for file watcher - Order of operations - Windows builds crashing randomly +- Crash on opencascade operations with invalid arguments ## [v0.0.1] - 2023-02-10 diff --git a/crates/opencascade/src/command.rs b/crates/opencascade/src/command.rs index a6f902e..27f1424 100644 --- a/crates/opencascade/src/command.rs +++ b/crates/opencascade/src/command.rs @@ -22,7 +22,11 @@ pub trait Builder: Command { pin.pin_mut().build(&progress); } - // SAFETY: safe since is_done and build were checked - Ok(unsafe { pin.pin_mut().value() }) + if !pin.is_done() { + Err("opencascade operation failed".into()) + } else { + // SAFETY: safe since is_done and build were checked + Ok(unsafe { pin.pin_mut().value() }) + } } }