]> gitweb.erp-flowers.ru Git - erp24_rep/yii-erp24/.git/commit
fix(ERP-250): add null check for WriteOffsErp model in actionUpdate origin/feature_filippov_ERP-250_fix_writeoffs_null_check
authorAleksey Filippov <Aleksey.Filippov@erp-flowers.ru>
Mon, 2 Mar 2026 08:16:52 +0000 (11:16 +0300)
committerAleksey Filippov <Aleksey.Filippov@erp-flowers.ru>
Mon, 2 Mar 2026 08:16:52 +0000 (11:16 +0300)
commitf10428e28ac2f62ffe3f6a8f9fa8b9e571a3393d
tree2ff85fb7d8f91c0e7b209bc8c962cf86056f5124
parentc29bc5f920c84e6bb0659623acb0e2a1c7264cb9
fix(ERP-250): add null check for WriteOffsErp model in actionUpdate

$query->one() can return null when the record is deleted, sent to 1C,
or the user has no store access. Without the check, line 1076 crashes
with "Call to a member function getRelation() on null".

Now throws NotFoundHttpException (404) as documented in the PHPDoc.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
erp24/controllers/WriteOffsErpController.php