ServiceStack/ServiceStack — pull request #574 by jfoshee (2013-04-05 20:17:31+00:00)
Title: Resolves Issue #573

The null reference was for MemberExprBlock.valueFn in Write(….).
valueFn would ideally be initialized during
ForEachStatementExprBlock.OnFirstRun(). However, at that time
memberExprEnumerator is empty, thus DoFirstRun does not get called for
each of the ChildBlocks. As far as I can tell, the reason for this is
that there is no value to set in ScopeArgs from which
MemberExprBlock.OnFirstRun would get the item's type... So a redesign
of this mechanic may be necessary to resolve this in a more elegant way.