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
F2991646: D25703.1740196451.diff
Fri, Feb 21, 03:54
F2991645: D25703.1740196450.diff
Fri, Feb 21, 03:54
F2991644: D25703.1740196448.diff
Fri, Feb 21, 03:54
F2991642: D25703.1740196447.diff
Fri, Feb 21, 03:54
F2988313: D25703.1740144061.diff
Thu, Feb 20, 13:21
F2980207: D25703.1739880488.diff
Mon, Feb 17, 12:08
F2977301: D25703.1739631410.diff
Fri, Feb 14, 14:56
F2977116: D25703.1739610925.diff
Fri, Feb 14, 09:15

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
Branch
fix-trim-null-empty-fields
Lint
Lint Passed
Unit
Tests Passed
Build Status
Buildable 1556
Build 1556: arc lint + arc unit

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