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

Add null check in AutorouteEntries #16020

Merged
merged 1 commit into from
May 9, 2024
Merged

Conversation

MikeAlhayek
Copy link
Member

For some reason the AutorouteEntries is throwing a null exception because the passed value being used is null.
Adding null check to provide the correct error.

@hishamco
Copy link
Member

hishamco commented May 9, 2024

I think you can apply this to all public APIs in the module, instead of doing it in a single class

@MikeAlhayek
Copy link
Member Author

Probably. I just did it here because I encountered an issue with this class

@MikeAlhayek MikeAlhayek merged commit c20c63e into main May 9, 2024
7 checks passed
@MikeAlhayek MikeAlhayek deleted the ma/autoroute-nullcheck branch May 9, 2024 14:44
@hishamco
Copy link
Member

hishamco commented May 9, 2024

Believe it or not, all public APIs should be protected by such guards

@Piedone
Copy link
Member

Piedone commented May 10, 2024

Yeah, though that class didn't really have similar methods (if we want to be diligent, all of them need null-checks though, but that's probably unnecessary, since null values should be a coding problem already and they'll fail anyway). Nevertheless, please do wait for an approve next time, Mike, until we have discussions settled under a PR.

@hishamco
Copy link
Member

but that's probably unnecessary, since null values should be a coding problem already and they'll fail anyway)

Public & protected APIs should use guards to save us from unexpected results

@MikeAlhayek
Copy link
Member Author

Yes I agree. That is something we should do thought out the project.

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