fix(jetton): Incompatible types Address and <null> for binary operator != #17
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I see the issue. In Tact, when dealing with optional addresses, we need to use a different approach for null checks. The error occurs because we're trying to directly compare an Address type with null. Instead, we should check if the address is initialized.
Replaced msg.response_destination != null with msg.response_destination.toString() != ""
old
tonion-contracts/contracts/traits/tokens/jetton/JettonMaster.tact
Line 72 in 57e84a2
msg.response_destination != null
New
https://github.com/satyasai69/tonion-contracts/blob/46afc19a4c081041aabe054d532fe59188bf30ac/contracts/traits/tokens/jetton/JettonMaster.tact#L72
msg.response_destination.toString() != ""
This new check properly handles the Address type and checks if it's initialized