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

Don't allow undefined in Address constructor #74

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open

Don't allow undefined in Address constructor #74

wants to merge 5 commits into from

Conversation

lcswillems
Copy link

Currently this code is allowed:

new Address(undefined);

But this code doesn't make sense and is bug-prone. I discovered several bugs in my code because I passed undefined to Address constructor.

ccorcoveanu and others added 5 commits August 12, 2021 21:31
Currently this code is allowed:

```
new Address(undefined);
```

But this code doesn't make sense and is bug-prone. I discovered several bugs in my code because I passed `undefined` to `Address` constructor.
@andreibancioiu andreibancioiu changed the base branch from main to development October 22, 2021 20:54
@andreibancioiu andreibancioiu changed the base branch from development to main March 10, 2022 08:51
@andreibancioiu
Copy link
Contributor

andreibancioiu commented Mar 14, 2022

Hi @lcswillems,

Currently, we use new Address() in many places, as a placeholder for not-yet-provided addresses - a bit similar to using the pattern called null object. Is it OK to keep it as it is, and perhaps close this issue?

Thanks 🙏

@lcswillems
Copy link
Author

Hi @andreibancioiu,

You can do as you wish. This is not my lib. If I opened this PR, it is because I believe it is not a good practice to allow undefined. And I don't get in which case new Address(undefined) would make sense?

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.

3 participants