Added error handling for null and empty string inputs for the isValidEtokenAddress and isValidXecAddress functions within validation.js
Details
- Reviewers
bytesofman - Group Reviewers
Restricted Project - Commits
- rABC801711555788: [Cashtab] Improve error handling in validation.js
npm test
ensure validation.test.js test suites pass successfully
Diff Detail
- Repository
- rABC Bitcoin ABC
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
Hey, looks like a good diff -- was there a specific code issue that this was required for?
If not, nbd since it's still an improvement -- but please create a task to associate with this diff.
This diff came about based on one of your comments in D10758 in that there's no need for null checks in cashmethod's new convertEtokenToEcashAddr function since this is already taken care of in validation's isValidEtokenAddress. However when I looked at isValidEtokenAddress there weren't any null checks, which leads to null pointer exceptions when a null input unit test is added for the convertEtokenToEcashAddr function.
Current plan is to retain the null check in D10758 as coded, and then when this lands I'll back it out.