File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed
app/code/Magento/User/Model/ResourceModel Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -259,11 +259,13 @@ public function delete(\Magento\Framework\Model\AbstractModel $user)
259
259
$ uid = $ user ->getId ();
260
260
$ connection ->beginTransaction ();
261
261
try {
262
- $ connection ->delete ($ this ->getMainTable (), ['user_id = ? ' => $ uid ]);
263
- $ connection ->delete (
264
- $ this ->getTable ('authorization_role ' ),
265
- ['user_id = ? ' => $ uid , 'user_type = ? ' => UserContextInterface::USER_TYPE_ADMIN ]
266
- );
262
+ if ($ uid ) {
263
+ $ connection ->delete ($ this ->getMainTable (), ['user_id = ? ' => $ uid ]);
264
+ $ connection ->delete (
265
+ $ this ->getTable ('authorization_role ' ),
266
+ ['user_id = ? ' => $ uid , 'user_type = ? ' => UserContextInterface::USER_TYPE_ADMIN ]
267
+ );
268
+ }
267
269
} catch (\Magento \Framework \Exception \LocalizedException $ e ) {
268
270
$ connection ->rollBack ();
269
271
return false ;
You can’t perform that action at this time.
0 commit comments