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.
Tags
None
Referenced Files
F3300772: D25703.1743046858.diff
Wed, Mar 26, 03:40
F3298492: D25703.1743003635.diff
Tue, Mar 25, 15:40
F3294448: D25703.1742934976.diff
Mon, Mar 24, 20:36
F3291815: D25703.1742882686.diff
Mon, Mar 24, 06:04
F3289370: D25703.1742844723.diff
Sun, Mar 23, 19:32
F3283492: D25703.1742752015.diff
Sat, Mar 22, 17:46
F3282868: D25703.1742730363.diff
Sat, Mar 22, 11:46
F3281303: D25703.1742677150.diff
Fri, Mar 21, 20:59

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