Fix warning when types do not have a parent type
[gitmo/MooseX-Storage.git] / lib / MooseX / Storage / Engine.pm
index 753d4d8..84c3082 100644 (file)
@@ -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