Call to getAccountName() on Null Object for Deleted Users in AuctionBidListBuilder

Created on 7 September 2023, 10 months ago
Updated 31 October 2023, 8 months ago

Problem/Motivation

When attempting to view bids made by a user who has been deleted from the system, an error occurs. This situation is not uncommon in real-world scenarios, as users have the ability to delete their accounts or request deletion by an administrator.

Steps to reproduce

1. Have a user account.
2. Place bids on an auction.
3. Delete the user account associated with the bids.
4. Attempt to view the bids on the auction.

Proposed resolution

The issue seems to occur during the process of building a list of auction bids. When a user who has placed bids is deleted from the system, their associated information becomes inaccessible. In this case, the `getAccountName()` function is being called on an object that no longer exists, resulting in a null value.

To address this error, you may need to implement error handling and validation checks within the `AuctionBidListBuilder.php` file. This code should check whether the user associated with a bid still exists before attempting to retrieve their account name. If the user no longer exists, you can handle this situation gracefully, perhaps by displaying a message indicating that the user has been deleted.

Additionally, consider reviewing your system's user deletion process to ensure that user data is appropriately managed when accounts are deleted or when users request deletion, to prevent similar errors from occurring in the future.

πŸ› Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

πŸ‡³πŸ‡ΏNew Zealand garethhallnz

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.69.0 2024