My preview works fine through Tridion UI and also through template builder.
When I publish the page I get the following error.
JScriptException: Expression 'RenderComponentPresentation()' had error 'Object reference not set to an instance of an object.'
I have this statement in my TBB.
Tridion.ContentManager.Publishing.Rendering.Binary b = engine.PublishingContext.RenderedItem.AddBinary(file, "image.png", strGroup, name, "image/png");
I also do not get any error logs in Tridion events. But I have a warning like this.This warning ocurs as well in other environment also but still publish is success.
AddBinary was called with relatedComponent=null resulting in unmanaged binaries in Content Delivery. Please specify a related Component to prevent issues with (un)deploying binaries.
The same page is also getting published in another Tridion environment.
Can you suggest any reason for this.