This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
GvIO(gv) returns NULL for a NULL gv, so refactor to take advantage of this.