Regression in the Mass indexer due to the fix for HSEARCH-1201

Description

Hi,

While fixing HSEARCH-1201, we introduced a bug in commit: https://github.com/hibernate/hibernate-search/commit/2f7844857bfafb951564ae136e646f6cf801add2

This bug causes the mass indexer to not index relations if they are proxyfied. In our case, we didn't have any error but after a mass indexing, our indexes didn't contain the information from @IndexedEmbedded fields, as soon as we put a LAZY on them.

Pull request to follow with the (trivial) fix: we need to return the initialized object if it's not null.

I'm working on a self contained test case, too.

Sorry for not noticing this issue while I reviewed the patch.

Environment

None

Status

Assignee

Guillaume Smet

Reporter

Guillaume Smet

Labels

None

Suitable for new contributors

None

Pull Request

None

Feedback Requested

None

Components

Fix versions

Affects versions

4.2.0.Beta2

Priority

Critical