Fix getRelationRecords for compound relation

It looks like there is a typo, isn't it?
If this is a typo, is this a valid fix?

Sorry I'm quite new to this project.
I don't understand it fully yet.
Please forgive me if I'm wrong.