mirror of
https://gitlab.com/oeffi/public-transport-enabler.git
synced 2025-07-18 00:09:55 +00:00
HttpClient: Add null checks to getInputStream().
This commit is contained in:
parent
b18ec864a9
commit
3e2aa33f6f
1 changed files with 5 additions and 0 deletions
|
@ -17,6 +17,8 @@
|
||||||
|
|
||||||
package de.schildbach.pte.util;
|
package de.schildbach.pte.util;
|
||||||
|
|
||||||
|
import static com.google.common.base.Preconditions.checkNotNull;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.net.HttpURLConnection;
|
import java.net.HttpURLConnection;
|
||||||
import java.nio.charset.Charset;
|
import java.nio.charset.Charset;
|
||||||
|
@ -150,6 +152,9 @@ public final class HttpClient {
|
||||||
|
|
||||||
public void getInputStream(final Callback callback, final HttpUrl url, final String postRequest,
|
public void getInputStream(final Callback callback, final HttpUrl url, final String postRequest,
|
||||||
final String requestContentType, Charset requestEncoding, final String referer) throws IOException {
|
final String requestContentType, Charset requestEncoding, final String referer) throws IOException {
|
||||||
|
checkNotNull(callback);
|
||||||
|
checkNotNull(url);
|
||||||
|
|
||||||
if (requestEncoding == null)
|
if (requestEncoding == null)
|
||||||
requestEncoding = Charsets.ISO_8859_1;
|
requestEncoding = Charsets.ISO_8859_1;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue