Skip to content
New issue

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

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

Already on GitHub? # to your account

use static equals method to avoid exception #1583

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

testfirstcoder
Copy link
Contributor

user.Password could be null.

@josephdecock
Copy link
Member

Is it actually possible to create a TestUser instance without a password, or to submit the QuickStart ui's login page without entering a password? If so, maybe we should prevent that. Ultimately the TestUserStore isn't meant for production, so we should just make the developer experience as good as possible.

@testfirstcoder
Copy link
Contributor Author

testfirstcoder commented Aug 19, 2024

The previous line checks explicit the possible null value for user password.

if (string.IsNullOrWhiteSpace(user.Password)

Right. The type is for testing purpose only.

Nevertheless we could use Object.Equals or String.Equals methods to make a safer comparision and avoid a possible System.NullReferenceException.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants