From 83ae193ee0f4d1f1d73d0deba3ac0b3c347f53c9 Mon Sep 17 00:00:00 2001 From: Katherine Kiefer Date: Thu, 9 May 2024 15:53:25 +1000 Subject: [PATCH] this can be null --- crates/byondapi-rs/src/lib.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/crates/byondapi-rs/src/lib.rs b/crates/byondapi-rs/src/lib.rs index c2b26ed..3481d98 100644 --- a/crates/byondapi-rs/src/lib.rs +++ b/crates/byondapi-rs/src/lib.rs @@ -29,6 +29,9 @@ pub unsafe fn parse_args( argc: byondapi_sys::u4c, argv: *mut ByondValue, ) -> &'static mut [ByondValue] { + if argv.is_null() { + return &[]; + } unsafe { std::slice::from_raw_parts_mut(argv, argc as usize) } }