ignore undefined values in uri_for and uri_with
[catagits/Catalyst-Runtime.git] / lib / Catalyst.pm
index e18ba6c..f1bfec4 100644 (file)
@@ -881,7 +881,7 @@ sub uri_for {
         if( $isa_ref and $isa_ref ne 'ARRAY' ) {\r
             croak( "Non-array reference ($isa_ref) passed to uri_for()" );\r
         }\r
-        utf8::encode( $_ ) for $isa_ref ? @$value : $value;\r
+        utf8::encode( $_ ) for grep { defined } $isa_ref ? @$value : $value;\r
     };
     
     # join args with '/', or a blank string