Laxen the error condition for delegation methods
[gitmo/Moose.git] / lib / Moose / Meta / Method / Delegation.pm
index 1118b1e..88ea1fa 100644 (file)
@@ -81,9 +81,9 @@ sub _initialize_body {
         my $proxy    = $instance->$accessor();
 
         my $error
-            = !defined $proxy ? ' is not defined'
-            : !blessed $proxy ? qq{ is not an object (got '$proxy')}
-            :                   undef;
+            = !defined $proxy                 ? ' is not defined'
+            : ref($proxy) && !blessed($proxy) ? qq{ is not an object (got '$proxy')}
+            : undef;
 
         if ($error) {
             $self->throw_error(