Kaynağa Gözat

修复空引用

loki.wu 2 yıl önce
ebeveyn
işleme
c3184eb4a1

+ 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;