From 0c9c94748b5855ef4ef1b27423a014118b8d16c9 Mon Sep 17 00:00:00 2001 From: jkim Date: Thu, 27 Jun 2024 10:57:07 +0100 Subject: [PATCH] Fix PHP 8.1 "trim(null)" exception when creating a diff with an empty "Differential Revision:" field Summary: This revision fixes a `trim(null)` exception when creating a diff with an empty field. Fixes: T15868 Test Plan: 1. Create a commit with an empty "Differential Revision:" field 2. Run `arc diff` Reviewers: O1 Blessed Committers, valerio.bozzolan Reviewed By: O1 Blessed Committers, valerio.bozzolan Subscribers: avivey, tobiaswiese, valerio.bozzolan, Matthew, Cigaryno Differential Revision: https://we.phorge.it/D25703 --- src/workflow/ArcanistDiffWorkflow.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/workflow/ArcanistDiffWorkflow.php b/src/workflow/ArcanistDiffWorkflow.php index f8a627d7..a7d11fde 100644 --- a/src/workflow/ArcanistDiffWorkflow.php +++ b/src/workflow/ArcanistDiffWorkflow.php @@ -1938,6 +1938,10 @@ EOTEXT continue; } + if ($value === null) { + continue; + } + if (is_array($value)) { // For array values, merge the arrays, appending the new values. // Examples are "Reviewers" and "Cc", where this produces a list of