diff --git a/src/Psalm/Report/XmlReport.php b/src/Psalm/Report/XmlReport.php index 1d657c70cbb..99eef77e0e3 100644 --- a/src/Psalm/Report/XmlReport.php +++ b/src/Psalm/Report/XmlReport.php @@ -29,6 +29,9 @@ static function (IssueData $issue_data): array { ); } + // replace null values, as XML serializers tend to have problems with them + $issue_data['taint_trace'] ??= ''; + if (null !== $issue_data['other_references']) { $issue_data['other_references'] = array_map( static fn(DataFlowNodeData $reference): array => (array) $reference, @@ -36,6 +39,9 @@ static function (IssueData $issue_data): array { ); } + // replace null values, as XML serializers tend to have problems with them + $issue_data['other_references'] ??= ''; + return $issue_data; }, $this->issues_data