From eb1ffa40dc55fd78060691ecc01240d739f6b4cb Mon Sep 17 00:00:00 2001 From: gedoor Date: Wed, 20 Oct 2021 11:21:25 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/java/io/legado/app/help/http/HttpHelper.kt | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/io/legado/app/help/http/HttpHelper.kt b/app/src/main/java/io/legado/app/help/http/HttpHelper.kt index c995ce8de..3e5ac9fa7 100644 --- a/app/src/main/java/io/legado/app/help/http/HttpHelper.kt +++ b/app/src/main/java/io/legado/app/help/http/HttpHelper.kt @@ -44,10 +44,8 @@ val okHttpClient: OkHttpClient by lazy { .build() chain.proceed(request) }) - if (AppConfig.isCronet && CronetLoader.install()) { - cronetEngine?.let { - builder.addInterceptor(CronetInterceptor(null)) - } + if (AppConfig.isCronet && CronetLoader.install() && cronetEngine != null) { + builder.addInterceptor(CronetInterceptor(null)) } builder.build() }