NRE and players losing backpacks itemsFixed

NullReferenceException: Object reference not set to an instance of an object
at Oxide.Plugins.Backpacks+EntityData.Setup (BaseEntity entity) [0x001fb] in <df96949fcd3c40ce9cdd32a5dc0f4836>:0
at Oxide.Plugins.Backpacks+ItemData.Setup (Item item, System.Int32 positionOffset) [0x001f7] in <df96949fcd3c40ce9cdd32a5dc0f4836>:0
at Oxide.Plugins.Backpacks+ItemContainerAdapter.SerializeTo (System.Collections.Generic.List`1[T] saveList, System.Collections.Generic.List`1[T] itemsToReleaseToPool) [0x0002d] in <df96949fcd3c40ce9cdd32a5dc0f4836>:0
at Oxide.Plugins.Backpacks+Backpack.SaveIfChanged () [0x00026] in <df96949fcd3c40ce9cdd32a5dc0f4836>:0
at Oxide.Plugins.Backpacks+BackpackManager+<SaveAllAndKill>d__32.MoveNext () [0x0009e] in <df96949fcd3c40ce9cdd32a5dc0f4836>:0
at UnityEngine.SetupCoroutine.InvokeMoveNext (System.Collections.IEnumerator enumerator, System.IntPtr returnValueAddress) [0x00026] in <8aebd7627ade4efeae84aca54d1d32ad>:0

Thanks for reporting this issue and providing the error message. I have identified one possible cause of the NRE in the EntityData.Setup method. It shouldn't happen under normal circumstances, but if a trophy head item was created improperly via another plugin, then that item were placed in a backpack, that could cause this error. I tested with Restore Upon Death and was able to reproduce the issue by dying with a head bag, then placing the head bag in the backpack and running server.save.

Edit: I have released an update to the plugin (v3.13.3) which fixes this.

Locked automatically