Page MenuHomePhorge

Fix exception accessing a non-existing EditEngine
ClosedPublic

Authored by aklapper on Apr 19 2024, 10:58.

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
Lint
Lint Not Applicable
Unit
Tests Not Applicable