Fixes S248243: we know check for VitoConfig initialization before trying to use it
@@ -373,6 +373,7 @@ public class FrescoVitoImage2Spec {
@OnRegisterRanges
static void registerWorkingRanges(
ComponentContext c, @Prop(optional = true) final @Nullable Prefetch prefetch) {
+ if (FrescoVitoProvider.hasBeenInitialized()) {
PrefetchConfig prefetchConfig = FrescoVitoProvider.getConfig().getPrefetchConfig();
if (shouldPrefetchWithWorkingRange(prefetch)) {
FrescoVitoImage2.registerImagePrefetchWorkingRange(
@@ -388,6 +389,7 @@ public class FrescoVitoImage2Spec {
FrescoVitoImage2.registerAboveWorkingRange(c, new AboveViewportWorkingRange());
}
}
+ }
static void cancelWorkingRangePrefetch(
final @Nullable AtomicReference<DataSource<Void>> prefetchData) {
