Allow null DataSink.Factory in CacheDataSourceFactory

CacheDataSource allows null DataSink. Do the same in CacheDataSourceFactory.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=149750696
This commit is contained in:
eguven 2017-03-10 05:54:25 -08:00 committed by Oliver Woodman
parent cb0187959c
commit f21cdcb9c5

View File

@ -68,7 +68,8 @@ public final class CacheDataSourceFactory implements DataSource.Factory {
public CacheDataSource createDataSource() {
return new CacheDataSource(cache, upstreamFactory.createDataSource(),
cacheReadDataSourceFactory.createDataSource(),
cacheWriteDataSinkFactory.createDataSink(), flags, eventListener);
cacheWriteDataSinkFactory != null ? cacheWriteDataSinkFactory.createDataSink() : null,
flags, eventListener);
}
}