diff --git a/src/rust/src/ctorust.rs b/src/rust/src/ctorust.rs index 02bd94363..0101951b0 100755 --- a/src/rust/src/ctorust.rs +++ b/src/rust/src/ctorust.rs @@ -121,19 +121,25 @@ impl FromCType for DecoderDtvccSettings { { services_enabled[i] = flag != 0; } + // Handle timing - use default if pointer is null to avoid losing other settings + let timing = if settings.timing.is_null() { + CommonTimingCtx::default() + } else { + CommonTimingCtx::from_ctype(settings.timing).unwrap_or_default() + }; Some(DecoderDtvccSettings { enabled: settings.enabled != 0, print_file_reports: settings.print_file_reports != 0, no_rollup: settings.no_rollup != 0, report: if !settings.report.is_null() { - Some(DecoderDtvccReport::from_ctype(settings.report)?) + DecoderDtvccReport::from_ctype(settings.report) } else { None }, active_services_count: settings.active_services_count, services_enabled, - timing: CommonTimingCtx::from_ctype(settings.timing)?, + timing, }) } }