UnassignedReferenceException when add handle texture with OpenVR

I use this code trying to make appear a texture in openvr using Unity but i get the UnassignedReferenceException when try to add the handle texture inside OnGUI, but the texture is well asigned and has a value

var overlay = OpenVR.Overlay;
if (overlay != null)
{
var texture = new Texture_t();
texture.handle = handletexture.GetNativeTexturePtr();
texture.eType = SteamVR.instance.textureType;
texture.eColorSpace = EColorSpace.Auto;
overlay.SetOverlayTexture(progressBarOverlayHandle, ref texture);
}

I got to solve the UnassignedReferenceException but SetOverlayTexture doesnt draw any image on screen