--- lib/Mojo/IOLoop/Server.pm 2016-02-01 10:21:22.000000000 -0500 +++ lib/Mojo/IOLoop/Server.pm 2016-02-09 22:27:02.000000000 -0500 @@ -105,10 +105,11 @@ sub start { my $self = shift; weaken $self; + return unless $self->reactor; $self->reactor->io($self->{handle} => sub { $self->_accept }); } -sub stop { $_[0]->reactor->remove($_[0]{handle}) } +sub stop { $_[0]->reactor->remove($_[0]{handle}) if $_[0]->reactor} sub _accept { my $self = shift; --- lib/Mojo/UserAgent.pm 2016-02-02 07:29:25.000000000 -0500 +++ lib/Mojo/UserAgent.pm 2016-02-09 22:30:19.000000000 -0500 @@ -266,6 +266,7 @@ sub _remove { my ($self, $id) = @_; my $c = delete $self->{connections}{$id}; + return unless $c->{ioloop}; $self->_dequeue($c->{ioloop}, $id); $c->{ioloop}->remove($id); }