Commits

Anonymous committed 0acf8e5

fix for Bug #86828 for MooX-ClassAttribute: Can't call method "isa" on an undefined value at MooX/CaptainHook.pm line 27

  • Participants
  • Parent commits 61f04fe

Comments (0)

Files changed (1)

File lib/MooX/CaptainHook.pm

 	require Role::Tiny;
 	return !!1 if exists $Role::Tiny::INFO{$package};
 	return !!0 if exists $Moo::MAKERS{$package};
-	if ($INC{'Class/MOP.pm'} and my $classof = 'Class::MOP'->can('class_of')) {
+	if ($INC{'Class/MOP.pm'} and my $classof = 'Class::MOP'->can('class_of') and 'Class::MOP'->can('class_of')->($package)) {
 		return !!1 if $classof->($package)->isa('Moose::Meta::Role');
 	}
 	return !!0;