Transform of disabled camera

I need to do some rendering synchronization with a plugin so I need to disable the camera and call Render() myself.

The problem is that I need to set and get the transform of the camera as well. If I try to access the transform using

Camera.main.transform

then I get this error:

Is this a Unity bug or is it supposed to work like that?

The docs say that Camera.main returns the first enabled camera tagged MainCamera. As your camera is disabled, it returns null.

Ok, clear.

I suppose the only way to get around this is by not calling Camera.main and using your own game object reference to your camera.