Skip to content

Commit c17d9aa

Browse files
committedSep 29, 2011
Allow PseudoRequest to handle 0 and '' correctly. Kudos to knowmad for pointing this behavior out.
1 parent f33c19d commit c17d9aa

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed
 

‎t/Asset/EMSSubmissionForm.t

+2-2
Original file line numberDiff line numberDiff line change
@@ -432,10 +432,10 @@ my $expected = {
432432
},
433433
'description' => undef,
434434
'_isValid' => 1,
435-
'deleteCreatedItems' => undef,
435+
'deleteCreatedItems' => 0,
436436
'canSubmitGroupId' => '2',
437437
'assetId' => 'new',
438-
'url' => undef,
438+
'url' => '',
439439
'daysBeforeCleanup' => '7',
440440
'title' => 'Untitled',
441441
} ;

‎t/lib/WebGUI/PseudoRequest.pm

+1-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ sub body {
8787
return keys %{ $self->{body} } if wantarray;
8888
return { %{ $self->{body} } };
8989
}
90-
if ($self->{body}->{$value}) {
90+
if (defined $self->{body}->{$value}) {
9191
if (wantarray && ref $self->{body}->{$value} eq "ARRAY") {
9292
return @{$self->{body}->{$value}};
9393
}

0 commit comments

Comments
 (0)
Please sign in to comment.