Skip to content

Commit

Permalink
Check argument type before calling count on it
Browse files Browse the repository at this point in the history
  • Loading branch information
Javier committed Jul 15, 2020
1 parent 632d348 commit cd56ea7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/MarkerUpper.php
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,8 @@ public static function formatErrorMessages($errors, $errorMessageHeader,$fieldMa
*/
public static function inlineFieldError($errors, $fieldName, $fieldMap)
{
if (count($errors) == 0) {
$hasErrors = is_countable($errors) ? count($errors) > 0 : false;
if (! $hasErrors) {
return false;
}

Expand Down

0 comments on commit cd56ea7

Please sign in to comment.