6fdf196
core: use correct scope of looking up units Fixes a bug introduced by 3b3557c410c7910fae0990599dcb82711cf5fbb7. Fixes #25625. (cherry picked from commit 47c57b4813c81187db86ed6e33ecf11f8a25825a)