Derek Hunziker
Derek Hunziker

Reputation: 13141

Glass.Mapper exception when rendering item is unavailable?

I have a placeholder that contains a collection of promos (view renderings). The promos in this collection are in Workflow, so on occasion, the page with the placeholder will get published before the promos do. When this occurs, the page throws the following error:

[NullReferenceException: Object reference not set to an instance of an object.]
Glass.Mapper.Sc.Pipelines.Response.GetModel.GetFromField(Rendering rendering, GetModelArgs args) +378

Despite my best efforts to check for nulls in the view rendering, I can't seem to get around this error. My feeling is that the promos that aren't published should simply not appear within the placeholder, however, this error appears to be occurring before the view gets rendered.

Any ideas on how to work around this?

Upvotes: 1

Views: 632

Answers (1)

Michael Edwards
Michael Edwards

Reputation: 6528

this was a bug. This has been fixed in the pre-release version. Please check this link on how to get hold if it http://glass.lu/download.html.

Upvotes: 1

Related Questions