Skip to content

Conversation

@mtwango
Copy link
Member

@mtwango mtwango commented Sep 30, 2025

@cbnolok
Copy link
Contributor

cbnolok commented Sep 30, 2025

What about adding an ASSERT(pItem != nullptr)? It shouldn't happen but if it does it's a null pointer dereference and it will cause the server to crash, so i'd be extra sure (i know it wasn't there even before, this would be a good moment to fix that as well).
Reading the other CComponentsProps, actually it would be a wise idea to add an ASSERT directly in each one's GetLink() method, provided we aren't using it in places where we expect a possibly null pointer, which i don't think we are doing

@mtwango
Copy link
Member Author

mtwango commented Oct 1, 2025

I've seen GetLink() methods on Champion, Spawn and ItemDamageable. Do you mean to assert pItem existence in each of them?

@cbnolok
Copy link
Contributor

cbnolok commented Oct 1, 2025

It might be worth adding that assert inside GetLink, yes, what do you think about it?

@mtwango
Copy link
Member Author

mtwango commented Oct 1, 2025

Yeah, good idea, especially at spawns. Added and tested on local save, no errors.

@cbnolok cbnolok merged commit 5e9b84e into Sphereserver:dev Oct 1, 2025
18 checks passed
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.

2 participants