浏览代码

删除文件时,防止文件为null

liuzhenxing1118 2 年之前
父节点
当前提交
d90a6a03bc
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      app/src/main/java/com/xplora/xpchat/activity/PagerActivity.java

+ 2 - 2
app/src/main/java/com/xplora/xpchat/activity/PagerActivity.java

@@ -907,10 +907,10 @@ public class PagerActivity extends BaseActivity implements Listener.PlayListener
             if (bean.type == Constant.MESSAGE_TYPE_VOICE ||
                     bean.type == Constant.MESSAGE_TYPE_PHOTO ||
                     bean.type == Constant.MESSAGE_TYPE_VIDEO) {
-                if (bean.filePath.length() > 1) {
+                if (bean.filePath != null && bean.filePath.length() > 1) {
                     FilePathUtils.deleteFile(bean.filePath);
                 }
-                if (bean.videoPath.length() > 1) {
+                if (bean.videoPath != null && bean.videoPath.length() > 1) {
                     FilePathUtils.deleteFile(bean.videoPath);
                 }
             }