소스 검색

Check if widget is mounted before precaching image

Vishnu Mohandas 5 년 전
부모
커밋
25de85aea6
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      lib/ui/zoomable_image.dart

+ 1 - 1
lib/ui/zoomable_image.dart

@@ -168,7 +168,7 @@ class _ZoomableImageState extends State<ZoomableImage>
 
   void _onLargeThumbnailLoaded(
       ImageProvider imageProvider, BuildContext context) {
-    if (!_loadedFinalImage) {
+    if (mounted && !_loadedFinalImage) {
       precacheImage(imageProvider, context).then((value) {
         if (mounted) {
           setState(() {