Skip to content

remove unsafe non-null assertion in Links.tsx#11711

Closed
rootvector2 wants to merge 1 commit intoDestinyItemManager:masterfrom
rootvector2:links-optional-chaining
Closed

remove unsafe non-null assertion in Links.tsx#11711
rootvector2 wants to merge 1 commit intoDestinyItemManager:masterfrom
rootvector2:links-optional-chaining

Conversation

@rootvector2
Copy link
Copy Markdown
Contributor

replace non null assertion with optional chaining to align with nearby pattern and improve null safety. No behavior change.

Copy link
Copy Markdown
Contributor

@bhollis bhollis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is harmless I suppose, but we know plugged is non null at this point and ? Is slightly slower than a normal property access. What problem is this solving?

@rootvector2
Copy link
Copy Markdown
Contributor Author

You're right the predicate ensures plugged is non-null here. I was aiming for consistency with the nearby masterworkSocket usage and avoiding non-null assertions where possible, but I agree this doesn't address a real issue. Happy to revert if preferred.

@bhollis bhollis closed this Apr 4, 2026
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.

3 participants