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

[bug] Null pointer exception in appkit for Unity. #50

Open
jhughes2112 opened this issue Feb 8, 2025 · 3 comments
Open

[bug] Null pointer exception in appkit for Unity. #50

jhughes2112 opened this issue Feb 8, 2025 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@jhughes2112
Copy link

Link to minimal reproducible example

This is not a reasonable request.

Summary

This line in AccountController.cs has a null pointer for ActiveChain in the UpdateBalance method:

                BalanceSymbol = _networkController.ActiveChain.NativeCurrency.symbol;

The context is this is a Windows program that displays a Unity modal on screen, then I connected my mobile metamask wallet. It appears that somehow this method is being called before the ActiveChain is set, although I have retrieved the Account object and properly determined that the chain is what I expected. It is a problem somewhere in the network controller not setting this properly. As far as I can tell, this exception causes other problems in the handling of the connection.

List of related npm package versions

"com.reown.appkit.unity": "1.2.1"

There is no apparent place to file bugs in the Unity version of AppKit, please advise.

Node.js Version

Unity

Package Manager

OpenUPM

@jhughes2112 jhughes2112 added the bug Something isn't working label Feb 8, 2025
Copy link

linear bot commented Feb 8, 2025

@skibitsky skibitsky transferred this issue from reown-com/appkit Feb 10, 2025
@skibitsky skibitsky self-assigned this Feb 10, 2025
@skibitsky
Copy link
Member

Hey @jhughes2112!

What chain did you have selected in the MetaMask and your Windows app during connection?

@jhughes2112
Copy link
Author

Sorry, I didn't realize the dotnet project contained the Unity code

Turns out we were testing on Base Sepolia test net and it was not in the list of default chains. Missing chains blows up in hard to identify ways. Would recommend adding a useful error message saying so, it would have saved a lot of time for us.

Second, we started taking the default chain set and adding whatever we are looking for. When there are two of the same chain, it throws a duplicate key exception. Also a a bit of a scramble to fix when we shifted to a production chain.

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants
@jhughes2112 @skibitsky and others