gi: fix undefined local variable

This is minimum patch.