mirror of https://github.com/sbt/sbt.git
Fix to issue #180 to handle null contentType
If the content type is null, the call for .toString on it will cause an NPE. This fixes this issue by wrapping the call in an Option, then mapping toString or falling back to null. getCharSetFromContentType handles null by returning ISO-8859-1
This commit is contained in:
parent
69fb352fa1
commit
42e23e54ff
|
|
@ -51,7 +51,7 @@ class GigahorseUrlHandler extends AbstractURLHandler {
|
|||
|
||||
if (checkStatusCode(url, response)) {
|
||||
val bodyCharset =
|
||||
BasicURLHandler.getCharSetFromContentType(response.body().contentType().toString)
|
||||
BasicURLHandler.getCharSetFromContentType(Option(response.body().contentType()).map(_.toString).orNull)
|
||||
Some(
|
||||
new SbtUrlInfo(true,
|
||||
response.body().contentLength(),
|
||||
|
|
|
|||
Loading…
Reference in New Issue