gi: fix wrong object check