Skip to content

Commit bce69ae

Browse files
committed
fix it correctly
1 parent 83ae193 commit bce69ae

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

crates/byondapi-rs/src/lib.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,11 @@ pub unsafe fn parse_args(
2929
argc: byondapi_sys::u4c,
3030
argv: *mut ByondValue,
3131
) -> &'static mut [ByondValue] {
32+
//oh fuck off
3233
if argv.is_null() {
33-
return &[];
34+
return unsafe {
35+
std::slice::from_raw_parts_mut(std::ptr::NonNull::<ByondValue>::dangling().as_ptr(), 0)
36+
};
3437
}
3538
unsafe { std::slice::from_raw_parts_mut(argv, argc as usize) }
3639
}

0 commit comments

Comments
 (0)