Fix an issue where we may "min()" an empty array when viewing a revision with no...
commit2188473fa77244ff0c2ab6e2c80a95bc73d8bb50
authorepriestley <git@epriestley.com>
Wed, 20 Apr 2022 16:34:00 +0000 (20 09:34 -0700)
committerepriestley <git@epriestley.com>
Wed, 20 Apr 2022 20:03:59 +0000 (20 13:03 -0700)
treee9877f03501758fb60bf12d3fa3893f7ee156fcc
parent52df4ff515b7d6ccb361846f971d47f4edbe9d04
Fix an issue where we may "min()" an empty array when viewing a revision with no changesets

Summary:
Ref T13667. When a revision's diff has no changesets (usually because Diffusion performed an automatic update with an empty commit), the UI currently tries to "min()" an empty array and fatals.

Handle this case properly.

Test Plan:
  - Created a revision with a diff with no changesets ("git commit --allow-empty" + copy-paste into web UI).
  - Viewed revision.
    - Before: "min()" fatal.
    - After: UI isn't perfect, but works without fataling.

Subscribers: cspeckmim

Maniphest Tasks: T13667

Differential Revision: https://secure.phabricator.com/D21760
src/infrastructure/diff/engine/PhabricatorInlineCommentAdjustmentEngine.php