NetworkTransform set to sync Rigidbody or Transform causes null reference exception

When a NetworkTransform is present on my player character and set to Sync Rigidbody3D or Sync Transform mode, NetworkServer.AddPlayerForConnection() fails with variations of the following exception:

NullReferenceException: Object reference not set to an instance of an object
UnityEngine.Networking.NetworkTransform.SerializeMode3D (UnityEngine.Networking.NetworkWriter writer)

The character has both a rigidbody and a transform (of course) on the same gameobject that the NetworkTransform is on and I don’t see any publicly exposed fields to set them manually. Meanwhile, setting the sync mode to “Sync Character Controller” causes no exceptions, despite the fact that my player character doesn’t have one of those (???)

Does anybody know what’s going on here or what I can do about it?

Looks like this was fixed in one of the later versions of Unity 5.1, so if you run into anything like this, try updating to the latest version.