diff --git a/Subsurface/Source/Items/Item.cs b/Subsurface/Source/Items/Item.cs index d28873cee..d7802d5b0 100644 --- a/Subsurface/Source/Items/Item.cs +++ b/Subsurface/Source/Items/Item.cs @@ -598,7 +598,18 @@ namespace Barotrauma if (contained.body != null) { - contained.body.FarseerBody.SetTransformIgnoreContacts(ref simPos, 0.0f); + try + { + contained.body.FarseerBody.SetTransformIgnoreContacts(ref simPos, 0.0f); + } + + catch (NullReferenceException e) + { +#if DEBUG + DebugConsole.ThrowError("SetTransformIgnoreContacts threw an exception in SetContainedItemPositions", e); +#endif + contained.body.SetTransform(simPos, 0.0f); + } } contained.Rect =