Fix for code added for #86425 which didn't actually work.
Added missing variable declaration.
Merge pull request #212 from luisromangz/8.5-SNAPSHOT-86425

8.5 snapshot 86425