Skip to content

Commit dbaaad9

Browse files
committed
Fix raster cache optional value check logic (flutter#42592)
Possible fix for flutter/flutter#128308
1 parent 220ece4 commit dbaaad9

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

flow/layers/layer_raster_cache_item.cc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ bool LayerRasterCacheItem::Draw(const PaintContext& context,
175175
bool LayerRasterCacheItem::Draw(const PaintContext& context,
176176
DlCanvas* canvas,
177177
const DlPaint* paint) const {
178-
if (!layer_children_id_.has_value() || !context.raster_cache || !canvas) {
178+
if (!context.raster_cache || !canvas) {
179179
return false;
180180
}
181181
switch (cache_state_) {
@@ -185,6 +185,9 @@ bool LayerRasterCacheItem::Draw(const PaintContext& context,
185185
return context.raster_cache->Draw(key_id_, *canvas, paint);
186186
}
187187
case RasterCacheItem::kChildren: {
188+
if (!layer_children_id_.has_value()) {
189+
return false;
190+
}
188191
return context.raster_cache->Draw(layer_children_id_.value(), *canvas,
189192
paint);
190193
}

0 commit comments

Comments
 (0)