Make BitmapProbeProducer nullsafe
@@ -17,10 +17,12 @@ import com.facebook.imagepipeline.cache.MemoryCache;
import com.facebook.imagepipeline.image.CloseableImage;
import com.facebook.imagepipeline.request.ImageRequest;
import com.facebook.imagepipeline.systrace.FrescoSystrace;
+import com.facebook.infer.annotation.Nullsafe;
/**
* Probe producer for brobing encoded memory and disk caches on bitmap memory cache hit requests.
*/
+@Nullsafe(Nullsafe.Mode.LOCAL)
public class BitmapProbeProducer implements Producer<CloseableReference<CloseableImage>> {
public static final String PRODUCER_NAME = "BitmapProbeProducer";
@@ -133,7 +135,8 @@ public class BitmapProbeProducer implements Producer<CloseableReference<Closeabl
final ImageRequest imageRequest = mProducerContext.getImageRequest();
final CacheKey cacheKey =
mCacheKeyFactory.getEncodedCacheKey(imageRequest, mProducerContext.getCallerContext());
- if (mProducerContext.getExtra(ProducerContext.ExtraKeys.ORIGIN).equals("memory_bitmap")) {
+ String producerContextExtra = mProducerContext.getExtra(ProducerContext.ExtraKeys.ORIGIN);
+ if (producerContextExtra != null && producerContextExtra.equals("memory_bitmap")) {
if (mProducerContext
.getImagePipelineConfig()
.getExperiments()
