Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(jetton): Incompatible types Address and <null> for binary operator != #17

Merged
merged 1 commit into from
Dec 10, 2024

Conversation

satyasai69
Copy link
Contributor

@satyasai69 satyasai69 commented Dec 10, 2024

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

if (msg.response_destination != null) {

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

@ZigBalthazar ZigBalthazar changed the title Incompatible types "Address" and "<null>" for binary operator "!=" fix(jetton): Incompatible types Address and <null> for binary operator != Dec 10, 2024
Copy link
Member

@ZigBalthazar ZigBalthazar left a comment

Choose a reason for hiding this comment

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

@satyasai69
Thank you for your valuable contribution.

@ZigBalthazar ZigBalthazar merged commit 8afe9f6 into ton-ion:main Dec 10, 2024
2 of 5 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