diff --git a/Sources/ZcashLightClientKit/Rust/ZcashRustBackend.swift b/Sources/ZcashLightClientKit/Rust/ZcashRustBackend.swift index 6377fd4d..a957e802 100644 --- a/Sources/ZcashLightClientKit/Rust/ZcashRustBackend.swift +++ b/Sources/ZcashLightClientKit/Rust/ZcashRustBackend.swift @@ -756,7 +756,11 @@ struct ZcashRustBackend: ZcashRustBackendWelding { } defer { zcashlc_free_boxed_slice(proposal) } - + + guard proposal.pointee.ptr != nil else { + throw ZcashError.rustShieldFunds(lastErrorMessage(fallback: "`proposeShielding` insufficient funds to shield")) + } + return try FfiProposal(contiguousBytes: Data( bytes: proposal.pointee.ptr, count: Int(proposal.pointee.len)