use Carp 'confess';
use Devel::GlobalDestruction qw( in_global_destruction );
-use Scalar::Util 'weaken', 'reftype';
+use Scalar::Util 'weaken', 'reftype', 'blessed';
use Sub::Name qw( subname );
use Class::MOP::Class;
my $self = shift;
my $class = shift;
+ return undef if !defined($class);
+
$class = blessed($class) || $class;
return get_metaclass_by_name($class);