We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
目前不管是否设置了cache缓存,第一句一定会去执行,然后就有可能报空指针异常。 private void setCacheConfig() { OkHttpConfig.defaultCachePath = this.context.getExternalCacheDir().getPath() + "/RxHttpCacheData"; if (this.isCache) { Cache cache; if (!TextUtils.isEmpty(this.cachePath) && this.cacheMaxSize > 0L) { cache = new Cache(new File(this.cachePath), this.cacheMaxSize); } else { cache = new Cache(new File(OkHttpConfig.defaultCachePath), 104857600L); }
OkHttpConfig.okHttpClientBuilder.cache(cache).addInterceptor(new NoNetCacheInterceptor()).addNetworkInterceptor(new NetCacheInterceptor()); } }
里面的第一句,如果设备获取getExternalCacheDir是null,那么后面还会执行getpath,然后就报空指针异常了。
The text was updated successfully, but these errors were encountered:
Sorry, something went wrong.
新版本已修复
No branches or pull requests
目前不管是否设置了cache缓存,第一句一定会去执行,然后就有可能报空指针异常。
private void setCacheConfig() {
OkHttpConfig.defaultCachePath = this.context.getExternalCacheDir().getPath() + "/RxHttpCacheData";
if (this.isCache) {
Cache cache;
if (!TextUtils.isEmpty(this.cachePath) && this.cacheMaxSize > 0L) {
cache = new Cache(new File(this.cachePath), this.cacheMaxSize);
} else {
cache = new Cache(new File(OkHttpConfig.defaultCachePath), 104857600L);
}
里面的第一句,如果设备获取getExternalCacheDir是null,那么后面还会执行getpath,然后就报空指针异常了。
The text was updated successfully, but these errors were encountered: