diff --git a/src/pc/network/packets/packet_spawn_objects.c b/src/pc/network/packets/packet_spawn_objects.c index 45be0401..bcb6a535 100644 --- a/src/pc/network/packets/packet_spawn_objects.c +++ b/src/pc/network/packets/packet_spawn_objects.c @@ -32,11 +32,15 @@ struct SpawnObjectData { static u32 generate_parent_id(struct Object* objects[], u8 onIndex, bool sanitize) { struct Object* o = objects[onIndex]; + if (!o) { return (u32)-1; } // special case if the parent is itself if (o->parentObj == o) { return (u32)-1; } if (onIndex == 0) { + if (!o->parentObj) { + return (u32)-1; + } if (sanitize && o->parentObj->oSyncID == 0) { return (u32)-1; }