Skip to content

Commit

Permalink
Prevent Str::startsWith being called with null on `Transaction:ge…
Browse files Browse the repository at this point in the history
…tAcceptedContentTypes`
  • Loading branch information
yvo-niedrich committed Aug 20, 2024
1 parent 940dc98 commit a1f1c5a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Controller/Transaction.php
Original file line number Diff line number Diff line change
Expand Up @@ -642,7 +642,7 @@ public function getAcceptedContentTypes(): MediaTypes
{
$formatQueryOption = $this->getFormat()->getValue();

if (Str::startsWith($formatQueryOption, ['json', 'xml'])) {
if ($formatQueryOption && Str::startsWith($formatQueryOption, ['json', 'xml'])) {
if (!in_array($formatQueryOption, ['json', 'xml'])) {
throw new BadRequestException(
'invalid_short_format',
Expand Down

0 comments on commit a1f1c5a

Please sign in to comment.