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)
Wed, May 1, 23:11
Unknown Object (File)
Wed, May 1, 16:16
Unknown Object (File)
Sun, Apr 28, 20:05
Unknown Object (File)
Sat, Apr 27, 03:33
Unknown Object (File)
Sat, Apr 27, 02:08
Unknown Object (File)
Fri, Apr 26, 23:31
Unknown Object (File)
Wed, Apr 24, 16:11
Unknown Object (File)
Tue, Apr 23, 17:22

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