소스 검색

文件物理删除后导致的异常

chendeben 1 년 전
부모
커밋
de33d93c82
1개의 변경된 파일5개의 추가작업 그리고 1개의 파일을 삭제
  1. 5 1
      entry/src/main/ets/viewmodel/VideoItem.ets

+ 5 - 1
entry/src/main/ets/viewmodel/VideoItem.ets

@@ -58,7 +58,11 @@ export class VideoItem  {
     this.videoSize = videoSize;
     this.cTime = cTime;
     if(StrUtil.isNotEmpty(this.filePath)&&this.type===CommonConstants.TYPE_LOCAL){
-      this.parentPath = FileUtil.getParentPath(this.filePath);
+      try {
+        this.parentPath = FileUtil.getParentPath(this.filePath);
+      }catch (e) {
+        this.parentPath=''
+      }
     }else{
       this.parentPath = ''
     }