Skip to content

Commit

Permalink
Avoided null error on count
Browse files Browse the repository at this point in the history
This commit avoids a warning when the library tries to call count() on a
non-array object. The issue is avoided by checking whether the object is
an array beforehand.

See #51
  • Loading branch information
Sebb767 committed Mar 26, 2021
1 parent 5c41c99 commit 7ed6bc9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Command/Delivery/DebugCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public function __construct($clients, $configurations = [])
$this->setDescription('Shows information about data coming from a certain client');
$this->addArgument(
'client-name',
\count($this->clients) > 1 ? InputArgument::REQUIRED : InputArgument::OPTIONAL,
\is_array($this->clients) && \count($this->clients) > 1 ? InputArgument::REQUIRED : InputArgument::OPTIONAL,
'The name of the client to use'
);
}
Expand Down

0 comments on commit 7ed6bc9

Please sign in to comment.