Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
23634de9
Commit
23634de9
authored
Apr 25, 2016
by
Adam Barth
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3535 from abarth/null_body
Handle the case of a null body in response.dart
parents
07951ee9
e5d09cb6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
1 deletion
+3
-1
response.dart
packages/flutter/lib/src/http/response.dart
+3
-1
No files found.
packages/flutter/lib/src/http/response.dart
View file @
23634de9
...
...
@@ -15,7 +15,7 @@ class Response {
/// The result of decoding [bodyBytes] using ISO-8859-1.
///
/// If [bodyBytes] is null, this will also be null.
String
get
body
=>
_encodingForHeaders
(
headers
).
decode
(
bodyBytes
);
String
get
body
=>
bodyBytes
==
null
?
null
:
_encodingForHeaders
(
headers
).
decode
(
bodyBytes
);
/// The raw byte stream.
final
Uint8List
bodyBytes
;
...
...
@@ -80,6 +80,8 @@ String _getCharset(String contentType) {
}
Encoding
_encodingForHeaders
(
Map
<
String
,
String
>
headers
)
{
if
(
headers
==
null
)
return
LATIN1
;
String
contentType
=
headers
[
'content-type'
];
if
(
contentType
==
null
)
return
LATIN1
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment