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

This will throw error is response is undefined #7

Open
Vishwas1 opened this issue Aug 3, 2023 · 0 comments
Open

This will throw error is response is undefined #7

Vishwas1 opened this issue Aug 3, 2023 · 0 comments
Assignees

Comments

@Vishwas1
Copy link
Contributor

Vishwas1 commented Aug 3, 2023

const { data, status, statusText } = response;

here if response is undefined then this destructure will throw an error saying can not read property of undefined, reading data. so proper check should be there before destructuring.

Same goes here

const { data } = resp;

WARNING: I have noticed this at many place , please be caution about destructuring

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

No branches or pull requests

2 participants