浏览代码

check if mounted

ashilkn 2 年之前
父节点
当前提交
2fe80cee31
共有 1 个文件被更改,包括 3 次插入1 次删除
  1. 3 1
      lib/ui/viewer/file/file_caption_widget.dart

+ 3 - 1
lib/ui/viewer/file/file_caption_widget.dart

@@ -56,7 +56,9 @@ class _FileCaptionWidgetState extends State<FileCaptionWidget> {
           final isSuccesful =
               await editFileCaption(context, widget.file, editedCaption);
           if (isSuccesful) {
-            Navigator.pop(context);
+            if (mounted) {
+              Navigator.pop(context);
+            }
           }
         }
       },