Skip to content

Use null-safe operator for character properties access#668

Merged
herpaderpaldent merged 2 commits into4.xfrom
fix/character-update
Apr 20, 2025
Merged

Use null-safe operator for character properties access#668
herpaderpaldent merged 2 commits into4.xfrom
fix/character-update

Conversation

@herpaderpaldent
Copy link
Contributor

No description provided.

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
@what-the-diff
Copy link

what-the-diff bot commented Apr 20, 2025

PR Summary

  • Improved Retrieval of 'corporation_id'
    We've upgraded the method we use to fetch the corporation_id from the character details. We're now using a technique that can cleverly prevent potential mistakes if the character details aren't available.

  • Enhanced Safety for 'alliance_id' Retrieval
    Just like we did above, we've also revised the method for fetching the alliance_id from character details. This modification boosts our code's defences, dramatically reducing the risk of troubles arising.

Removed redundant alias for CharacterInfoJob in test imports to improve code clarity and consistency. No functional changes were introduced.
@herpaderpaldent herpaderpaldent merged commit d9b6a7f into 4.x Apr 20, 2025
2 of 3 checks passed
@herpaderpaldent herpaderpaldent deleted the fix/character-update branch April 20, 2025 19:49
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