Page MenuHomePhorge

Fix exception accessing a non-existing EditEngine
ClosedPublic

Authored by aklapper on Apr 19 2024, 10:58.
Tags
None
Referenced Files
Unknown Object (File)
Thu, May 30, 22:07
Unknown Object (File)
Thu, May 30, 22:07
Unknown Object (File)
Thu, May 30, 22:07
Unknown Object (File)
Wed, May 22, 23:45
Unknown Object (File)
Wed, May 22, 23:45
Unknown Object (File)
Wed, May 22, 22:38
Unknown Object (File)
Wed, May 22, 21:51
Unknown Object (File)
Mon, May 20, 18:40

Details

Summary

Trying to access a non-existing edit engine "foo" via the URI /transactions/editengine/foo/ throws an unhandled exception.
PhabricatorEditEngine::getByKey($viewer, $engine_key) is null as $engine_key is non-existing foo.
Thus avoid calling setViewer() on null by splitting into a separate step after a null check.
When null, show a proper 404 error instead.

EXCEPTION: (Error) Call to a member function setViewer() on null at [<phorge>/src/applications/transactions/controller/PhabricatorEditEngineConfigurationListController.php:17]

Closes T15793

Test Plan

While logged in and with sufficient permissions,

Diff Detail

Repository
rP Phorge
Branch
T15793EditEngine (branched from master)
Lint
Lint Passed
Unit
Tests Passed
Build Status
Buildable 1189
Build 1189: arc lint + arc unit