ignore undefined values in uri_for and uri_with
[catagits/Catalyst-Runtime.git] / lib / Catalyst / Request.pm
index 46e0df6..d8ead36 100644 (file)
@@ -509,7 +509,7 @@ sub uri_with {
         if( $isa_ref and $isa_ref ne 'ARRAY' ) {
             croak( "Non-array reference ($isa_ref) passed to uri_with()" );
         }
-        utf8::encode( $_ ) for $isa_ref ? @$value : $value;
+        utf8::encode( $_ ) for grep{ defined } $isa_ref ? @$value : $value;
     };
     my $uri = $self->uri->clone;