Merge pull request #3215 from ByteHamster/crashes

Fixed ArrayIndexOutOfBoundsException
This commit is contained in:
H. Lehmann 2019-06-03 12:40:45 +02:00 committed by GitHub
commit 80ecfacb81
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 0 deletions

View File

@ -139,6 +139,11 @@ class ApOkHttpUrlLoader implements ModelLoader<String, InputStream> {
// add authentication
String[] auth = authentication.split(":");
if (auth.length != 2) {
Log.d(TAG, "Invalid credentials for '" + url + "'");
return chain.proceed(request);
}
String credentials = HttpDownloader.encodeCredentials(auth[0], auth[1], "ISO-8859-1");
Request newRequest = request
.newBuilder()