Skip to content

Use null-safe operator for character properties access#667

Merged
herpaderpaldent merged 1 commit into3.xfrom
fix/character_update
Apr 20, 2025
Merged

Use null-safe operator for character properties access#667
herpaderpaldent merged 1 commit into3.xfrom
fix/character_update

Conversation

@herpaderpaldent
Copy link
Contributor

Refactored character property access to use the null-safe operator (?->) for corporation_id and alliance_id. This ensures that the code handles cases where the character object may be null, improving overall robustness and preventing potential errors.

This addresses #665

Refactored character property access to use the null-safe operator (`?->`) for `corporation_id` and `alliance_id`. This ensures that the code handles cases where the `character` object may be null, improving overall robustness and preventing potential errors.
@what-the-diff
Copy link

what-the-diff bot commented Apr 20, 2025

PR Summary

  • Improved Character Property Access
    The code has been improved to handle cases where some properties of the character might not exist. It now uses a null coalescing operator (?->), which makes it safer and less prone to errors. Specifically, this change has been applied for both corporation_id and alliance_id in the CharacterBatchJob.php file.

@qlty-cloud-legacy
Copy link

Code Climate has analyzed commit 3f6739c and detected 0 issues on this pull request.

The test coverage on the diff in this pull request is 100.0% (50% is the threshold).

This pull request will bring the total coverage in the repository to 89.9% (0.0% change).

View more on Code Climate.

@herpaderpaldent herpaderpaldent merged commit fef1773 into 3.x Apr 20, 2025
5 checks passed
@herpaderpaldent herpaderpaldent deleted the fix/character_update branch April 20, 2025 18:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant