From: Florian Ragwitz Date: Fri, 1 May 2009 07:35:54 +0000 (+0200) Subject: Avoid modification of non-creatable array values. X-Git-Tag: 0.14~1 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=gitmo%2FMooseX-Types-Structured.git;a=commitdiff_plain;h=aa4718fef8106533dcfb8cf141091e824f4896b1 Avoid modification of non-creatable array values. --- diff --git a/lib/MooseX/Types/Structured.pm b/lib/MooseX/Types/Structured.pm index b0ee907..e336cd3 100644 --- a/lib/MooseX/Types/Structured.pm +++ b/lib/MooseX/Types/Structured.pm @@ -659,7 +659,7 @@ Moose::Util::TypeConstraints::get_type_constraint_registry->add_type_constraint( @$type_constraints : (); my $overflow_handler; - if(blessed $type_constraints[-1] + if($type_constraints[-1] && blessed $type_constraints[-1] && $type_constraints[-1]->isa('MooseX::Types::Structured::OverflowHandler')) { $overflow_handler = pop @type_constraints; } @@ -716,7 +716,7 @@ Moose::Util::TypeConstraints::get_type_constraint_registry->add_type_constraint( @$type_constraints : (); my $overflow_handler; - if(blessed $type_constraints[-1] + if($type_constraints[-1] && blessed $type_constraints[-1] && $type_constraints[-1]->isa('MooseX::Types::Structured::OverflowHandler')) { $overflow_handler = pop @type_constraints; }