Skip to content

Commit

Permalink
bug #54419 Fix TypeError on ProgressBar (Fan2Shrek)
Browse files Browse the repository at this point in the history
This PR was merged into the 6.4 branch.

Discussion
----------

Fix TypeError on ProgressBar

| Q             | A
| ------------- | ---
| Branch?       | 6.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Issues        | Fix #54386
| License       | MIT

`ProgressBar->getMessage()` returns null if the message is not defined

Commits
-------

adfe8df Fix TypeError on ProgressBar
  • Loading branch information
xabbuh committed Mar 28, 2024
2 parents 974be71 + adfe8df commit 04d547d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Symfony/Component/Console/Helper/ProgressBar.php
Original file line number Diff line number Diff line change
Expand Up @@ -183,9 +183,9 @@ public function setMessage(string $message, string $name = 'message'): void
$this->messages[$name] = $message;
}

public function getMessage(string $name = 'message'): string
public function getMessage(string $name = 'message'): ?string
{
return $this->messages[$name];
return $this->messages[$name] ?? null;
}

public function getStartTime(): int
Expand Down

0 comments on commit 04d547d

Please sign in to comment.