Skip to content

Commit

Permalink
fix: fix image load error cause crash. (#1187)
Browse files Browse the repository at this point in the history
  • Loading branch information
andycall authored Mar 1, 2022
1 parent 20b8930 commit f1ce4a5
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions kraken/lib/src/dom/elements/img.dart
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,7 @@ class ImageElement extends Element {
}

void _onImageError(Object exception, StackTrace? stackTrace) {
print('$exception\n$stackTrace');
dispatchEvent(Event(EVENT_ERROR));
}

Expand Down Expand Up @@ -391,6 +392,9 @@ class ImageElement extends Element {
forceToRepaintBoundary = true;
}

// Image may be detached when image frame loaded.
if (!isRendererAttached) return;

_attachImage();
_resizeImage();
}
Expand Down

0 comments on commit f1ce4a5

Please sign in to comment.