From: Tomas Doran Date: Thu, 10 Sep 2009 16:42:34 +0000 (+0100) Subject: Fix warning when types do not have a parent type X-Git-Tag: 0.22~7 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=gitmo%2FMooseX-Storage.git;a=commitdiff_plain;h=e0f8f2ee62542bf8dd62c5ffed1c8a85fbe2bbe6 Fix warning when types do not have a parent type --- diff --git a/Changes b/Changes index 6391e6a..30d336c 100644 --- a/Changes +++ b/Changes @@ -1,5 +1,7 @@ Revision history for MooseX-Storage + * Fix warnings when types do not have a parent type. + 0.21 * Fix inconsistent dist versions with Perl::Version diff --git a/lib/MooseX/Storage/Engine.pm b/lib/MooseX/Storage/Engine.pm index 753d4d8..84c3082 100644 --- a/lib/MooseX/Storage/Engine.pm +++ b/lib/MooseX/Storage/Engine.pm @@ -307,8 +307,8 @@ sub find_type_handler { # If both is true recurse this method # using ->type_parameter. return $self->find_type_handler($type_constraint->type_parameter) - if $type_constraint->parent eq 'Maybe' - and not $type_constraint->parent->can('type_parameter'); + if ($type_constraint->parent && $type_constraint->parent eq 'Maybe' + and not $type_constraint->parent->can('type_parameter')); # this should handle most type usages # since they they are usually just