The following code produces a NullReferenceException when calling RenderProducts:
var ps = Product.GetProductsByGroupID("my-group-id"); var r = new Renderer(); r.RenderProducts(ps, template);
var ps = Product.GetProductsByGroupID("my-group-id"); var r = new Renderer(); var loop = template.GetLoop("Products"); foreach (var p in ps) { r.RenderProduct(p, true, loop); loop.CommitLoop(); }
The following code will also NOT throw an exception:
var ps = Product.GetProductsByGroupID("my-group-id"); template.GetLoop("Products"); var r = new Renderer(); r.RenderProducts(ps, template);
I've attached the call stack if you are interested.