Fix .length on undefined WASM error (#6048)

This commit is contained in:
Jonathan Tran
2025-03-28 14:48:47 -04:00
committed by GitHub
parent 42123383bb
commit 36875e05fd
2 changed files with 7 additions and 8 deletions

View File

@ -121,6 +121,13 @@ impl EngineConnection {
}
})?;
if value.is_null() || value.is_undefined() {
return Err(KclError::Engine(KclErrorDetails {
message: "Received null or undefined response from engine".into(),
source_ranges: vec![source_range],
}));
}
// Convert JsValue to a Uint8Array
let data = js_sys::Uint8Array::from(value);