Comparing two arrays of different types

Looks like you have a recursive definition of Get Object Class, which can explain the inifinte loop (it only calls itself, never reaching the return node).

But it may be simpler to avoid this issue altogether by rethinkning how you handle being picked up or not, like suggested above