Page MenuHomePhorge

Fix PHP 8.1 "trim(null)" exception when creating a diff with an empty "Differential Revision:" field
ClosedPublic

Authored by jkimbo on Jun 27 2024, 09:58.

Details

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

Diff Detail

Repository
rARC Arcanist
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

jkimbo held this revision as a draft.
jkimbo published this revision for review.Jun 27 2024, 09:59

maybe just add if ($value === null) { continue; } somewhere before the this?

somewhere before the this

Uhm. Where? 🤔

src/workflow/ArcanistDiffWorkflow.php
1935

here-ish?

Move null check to earlier in function

jkimbo marked an inline comment as done.Aug 14 2024, 08:35

Sorry for the delay with this. I've moved the null check as suggested.

lgtm

Also without that comment in 1942. Feel free to omit. It's self-explaining.

This revision is now accepted and ready to land.Aug 19 2024, 12:49

Remove unecessary comment