Skip to content

Commit

Permalink
Item13963: Correct possible undefined error in Form.pm
Browse files Browse the repository at this point in the history
Issue found / fixed by VadimBelman
`
  • Loading branch information
gac410 committed Nov 9, 2016
1 parent 34b820d commit 6afb147
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions core/lib/Foswiki/Form.pm
Expand Up @@ -672,8 +672,11 @@ define the field.

sub getField {
my ( $this, $name ) = @_;
foreach my $fieldDef ( @{ $this->{fields} } ) {
return $fieldDef if ( $fieldDef->{name} && $fieldDef->{name} eq $name );
if ( defined $this->{fields} ) {
foreach my $fieldDef ( @{ $this->{fields} } ) {
return $fieldDef
if ( $fieldDef->{name} && $fieldDef->{name} eq $name );
}
}
return;
}
Expand Down

0 comments on commit 6afb147

Please sign in to comment.