summaryrefslogtreecommitdiff
path: root/ext/IO/lib/IO/Select.pm
diff options
context:
space:
mode:
Diffstat (limited to 'ext/IO/lib/IO/Select.pm')
-rw-r--r--ext/IO/lib/IO/Select.pm4
1 files changed, 3 insertions, 1 deletions
diff --git a/ext/IO/lib/IO/Select.pm b/ext/IO/lib/IO/Select.pm
index f021a797ec..79171023e6 100644
--- a/ext/IO/lib/IO/Select.pm
+++ b/ext/IO/lib/IO/Select.pm
@@ -46,7 +46,9 @@ sub remove
sub exists
{
my $vec = shift;
- $vec->[$vec->_fileno(shift) + FIRST_FD];
+ my $fno = $vec->_fileno(shift);
+ return undef unless defined $fno;
+ $vec->[$fno + FIRST_FD];
}