NullReferenceException: Object reference not set to an instance of an object at BaseModularVehicle.CreatePhysicalModuleEntityNot An Issue

Hello,

NullReferenceException: Object reference not set to an instance of an object
  at BaseModularVehicle.CreatePhysicalModuleEntity (Item moduleItem, Rust.Modular.ItemModVehicleModule itemModModule, System.Int32 socketIndex) [0x0002e] in <44809be716604d36a8e732d3bfefa3a7>:0
  at Rust.Modular.ModularVehicleInventory.ModuleItemAdded (Item moduleItem, System.Int32 socketIndex) [0x00027] in <44809be716604d36a8e732d3bfefa3a7>:0
  at Rust.Modular.ModularVehicleInventory.OnSocketInventoryAddRemove (Item moduleItem, System.Boolean added) [0x00003] in <44809be716604d36a8e732d3bfefa3a7>:0
  at ItemContainer.Insert (Item item) [0x00046] in <44809be716604d36a8e732d3bfefa3a7>:0
  at Item.SetParent (ItemContainer target) [0x00039] in <44809be716604d36a8e732d3bfefa3a7>:0
  at Item.MoveToContainer (ItemContainer newcontainer, System.Int32 iTargetPos, System.Boolean allowStack, System.Boolean ignoreStackLimit) [0x0033d] in <44809be716604d36a8e732d3bfefa3a7>:0
  at PlayerInventory.MoveItem (BaseEntity+RPCMessage msg) [0x00207] in <44809be716604d36a8e732d3bfefa3a7>:0
  at PlayerInventory.OnRpcMessage (BasePlayer player, System.UInt32 rpc, Network.Message msg) [0x001c9] in <44809be716604d36a8e732d3bfefa3a7>:0
UnityEngine.DebugLogHandler:Internal_LogException(Exception, Object)
UnityEngine.DebugLogHandler:LogException(Exception, Object)
UnityEngine.Logger:LogException(Exception, Object)
UnityEngine.Debug:LogException(Exception)
PlayerInventory:OnRpcMessage(BasePlayer, UInt32, Message)
BaseEntity:SV_RPCMessage(UInt32, Message)
ServerMgr:OnRPCMessage(Message)
ServerMgr:OnNetworkMessage(Message)
Facepunch.Network.Raknet.Server:ConnectedPacket(Connection)
Facepunch.Network.Raknet.Server:Cycle()
ServerMgr:Update()

(Filename: <44809be716604d36a8e732d3bfefa3a7> Line: 0)

76561############/Lith kicked: RPC Error in MoveItem​

I don't know how it happened and the player is not responding, I saw the error on the console.

we use only your plugin for vehicles so seems this plugin, not sure...

Thanks

This code path is vanilla. It doesn't look like it would be related to this plugin which gets invoked later, outside this code path.

How often does this happen?

NKXTQs24ExGTuL8.jpg WhiteThunder

This code path is vanilla. It doesn't look like it would be related to this plugin which gets invoked later, outside this code path.

How often does this happen?

Ok thanks and facepunch doesn't support modded server so ;(

I don't know how it happened and the player is not responding

From the looks of it, this error would probably happen if the player managed to drag an item into the car inventory which isn't an actual vehicle module item. Potentially any mod related to items could be allowing that by accident.

Ok, thanks for this tip's.

is it like looking for a needle in a haystack?^^

It should relatively easy to identify the cause. I would first try to move various random items into a car inventory to see if you can reproduce the above hypothesis. If you can, then search your plugin directory using an editor functionality like "find in files" (notepad++) for certain hooks like CanMoveItem or CanAcceptItem. That will quickly narrow down to a short list of plugins that might be allowing this. Then try unloading some and seeing if you can still reproduce. Then you will know which plugin is causing it.

It's possible that the above hypothesis is incorrect, but testing it should take under an hour and is worth doing.

Ive try a lot of car and possibility, cannot reproduce this error xD

Locked automatically