Commits

Toby Inkster committed 5818b00

silence some potential "in cleanup" errors

Comments (0)

Files changed (1)

lib/MooX/CaptainHook.pm

 	use overload qw[bool] => sub { 0 };
 	sub DESTROY {
 		'Moo::Role'->apply_single_role_to_package('Moo::HandleMoose', MooX::CaptainHook::ON_INFLATION)
-			unless Role::Tiny::does_role('Moo::HandleMoose', MooX::CaptainHook::ON_INFLATION);
+			if Moo::HandleMoose->can('inject_real_metaclass_for')
+			&& !Role::Tiny::does_role('Moo::HandleMoose', MooX::CaptainHook::ON_INFLATION);
 	}
 	if ($Moo::HandleMoose::SETUP_DONE)
 		{ __PACKAGE__->DESTROY }