Fixed issue with postcode validator

This commit is contained in:
Tom Bloor 2017-04-25 23:33:35 +01:00
parent aed22d1c98
commit ae6884202a
2 changed files with 5 additions and 2 deletions

View file

@ -32,7 +32,7 @@ sub register {
try {
$postcode = Geo::UK::Postcode->new( $value );
};
return defined $postcode && $postcode->valid ? undef : 1;
return defined( $postcode ) && ( $postcode->valid ) && ! ( $postcode->partial ) ? undef : 1;
});