Skip to content

Commit

Permalink
fix #525
Browse files Browse the repository at this point in the history
  • Loading branch information
jqhph committed Sep 7, 2020
1 parent 63aba2e commit 51e2f7f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Form/Builder.php
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,7 @@ public function field($name)
{
$field = $this->fields->first(function (Field $field) use ($name) {
if (is_array($field->column())) {
return in_array($name, $field->column(), true);
return in_array($name, $field->column(), true) ? $field : null;
}

return $field === $name || $field->column() === $name;
Expand Down
2 changes: 1 addition & 1 deletion src/Widgets/Form.php
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ public function field($name)
{
foreach ($this->fields as $field) {
if (is_array($field->column())) {
return in_array($name, $field->column(), true);
return in_array($name, $field->column(), true) ? $field : null;
}

if ($field === $name || $field->column() === $name) {
Expand Down

0 comments on commit 51e2f7f

Please sign in to comment.