From: Shawn M Moore Date: Sat, 28 Mar 2009 19:33:18 +0000 (-0400) Subject: Tweaks to class_of X-Git-Tag: 0.80~22 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=b1a46f91382e5b1d9a69a401162dcf13ca6b6ba9;p=gitmo%2FClass-MOP.git Tweaks to class_of --- diff --git a/lib/Class/MOP.pm b/lib/Class/MOP.pm index c288272..e99cc24 100644 --- a/lib/Class/MOP.pm +++ b/lib/Class/MOP.pm @@ -10,7 +10,7 @@ use MRO::Compat; 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; @@ -140,6 +140,8 @@ sub class_of { my $self = shift; my $class = shift; + return undef if !defined($class); + $class = blessed($class) || $class; return get_metaclass_by_name($class);