瀏覽代碼

修复空引用

loki.wu 2 年之前
父節點
當前提交
c3184eb4a1
共有 2 個文件被更改,包括 2 次插入2 次删除
  1. 1 1
      lib/data_host/web/broswer.dart
  2. 1 1
      lib/data_host/web/shell.dart

+ 1 - 1
lib/data_host/web/broswer.dart

@@ -11,7 +11,7 @@ class _VidDataHostBroswer implements VidDataHostInterface {
   VidFileDownloadCancelToken? _downloadCancelToken;
 
   @override
-  int get frameCount => _data!.imageCount;
+  int get frameCount => _data == null ? -1 : _data!.imageCount;
 
   @override
   VidUsProbe get probe => _data!.probe;

+ 1 - 1
lib/data_host/web/shell.dart

@@ -11,7 +11,7 @@ class _VidDataHostShell implements VidDataHostInterface {
   final String url;
 
   @override
-  int get frameCount => _data!.imageCount;
+  int get frameCount => _data == null ? -1 : _data!.imageCount;
 
   @override
   VidUsProbe get probe => _data!.probe;