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

The method '+' was called on null #3

Closed
Holofox opened this issue Sep 18, 2023 · 2 comments · Fixed by #4
Closed

The method '+' was called on null #3

Holofox opened this issue Sep 18, 2023 · 2 comments · Fixed by #4
Labels
bug Something isn't working
Milestone

Comments

@Holofox
Copy link

Holofox commented Sep 18, 2023

Hello! Thanks for the package! There is a problem with form data requests.

NoSuchMethodError: The method '+' was called on null.\nReceiver: null\nTried calling: +("Form data")]

I'm guessing the problem is on this line:

I also think it’s worth wrapping all the handlers in the interceptor in try/catch, so that in case of an error this does not affect the sending of the request. The error can be made non-blocking via handler.next() so that other interceptors can continue working.

void onRequest(RequestOptions options, RequestInterceptorHandler handler) {

void onResponse(Response response, ResponseInterceptorHandler handler) {

void onError(DioException error, ErrorInterceptorHandler handler) {

@kushalmahapatro kushalmahapatro added the bug Something isn't working label Sep 18, 2023
@kushalmahapatro
Copy link
Owner

Hey @Holofox , Thanks for pointing this out,
the body param is not yet initialized and +("Form data") was being appended to it.

Will fix this and let you know and I agree to your suggestion to handle the interceptors with try/catch, so that it wont hamper the Call, if the interception failed.

NoSuchMethodError: The method '+' was called on null.\nReceiver: null\nTried calling: +("Form data")]

@kushalmahapatro kushalmahapatro added this to the 0.1.2 milestone Sep 18, 2023
@kushalmahapatro kushalmahapatro linked a pull request Sep 18, 2023 that will close this issue
@kushalmahapatro
Copy link
Owner

@Holofox , The fix has been added in 0.1.2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants