SpringSource/grails-data-mapping — pull request #127 by longwa (2013-06-04 21:19:32+00:00)
Title: GRAILS-10162 - Don't NPE if trying to initialize a collection for which ...

...the indexer can't find the entity; better proxy initialization error messages.

Two changes:

1. If a collection is being initialized and the indexer doesn't know the entity, it is almost certainly the case that it's a unit test and it isn't mocked. In that case, there can't be any objects of that type so just don't try to add any results.

2. Another case where a proxy is trying to be unwrapped and the map doesn't have that entity, just provide a better error message instead of NPE.