-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Getting cookies from HttpClientResponse throws #34220
Comments
is there a way to speed this up? I'm stuck with this and can't upgrade to the newer version of flutter |
+1 |
Invalid value: Valid value range is empty: 0#0 same error and stop to wait for this bug has been fixed |
+1 |
here is some example code
Where you can pass in any URL that would have cookies returning, and cookieJar = response.cookies will return the error that the OP had posted. However, I noticed if you put a breakpoint on that line and wait, response.cookies will return values. |
Been looking into this with @gerryhigh and we've figured out the below. Was looking into where the exception is being raised
Seems its two things, first the length of value should be tested before you try to index -1, and second the check could indicate there is only 1 speech mark in which case you try to get
|
+1 |
I'm being bitten by this bug as well, and turned up the same result as slightfoot above. I'd love to contribute a patch since this appears to be a one-line change (and this bug is blocking time-sensitive development), but unfortunately there's not a lot of detail on how best to patch Dart and then bundle it into Flutter to test that patch. |
I wonder if this has been fixed in the latest version? We also came across this issue. Thanks. |
Ran into this bug using the latest version of flutter:
It's very concerning because it's been unresolved for almost a year and you can't guard against it, e.g. this still throws an error: try {
if (res.cookies != null && res.cookies.length > 0) {
}
} on RangeError catch (e) {
print("RangeError: " + e.toString());
//ignore https://github.com/dart-lang/sdk/issues/34220
} |
Hi, I fixed this bug (which is a duplicate of #35804) and the fix will be in the next stable release. |
RangeError (index): Invalid value: Valid value range is empty: 0
flutter/flutter#20898
The text was updated successfully, but these errors were encountered: