From fad7f20ed1b10206ea0a665088cd61b3fe6e9203 Mon Sep 17 00:00:00 2001 From: Matthew Date: Thu, 11 Jul 2024 09:36:13 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AF=B9=E8=B7=AF=E5=BE=84=E5=81=9A=E4=BF=9D?= =?UTF-8?q?=E6=8A=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/xypower/mpmaster/CrashHandler.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/mpmaster/src/main/java/com/xypower/mpmaster/CrashHandler.java b/mpmaster/src/main/java/com/xypower/mpmaster/CrashHandler.java index 98774910..826c74a7 100644 --- a/mpmaster/src/main/java/com/xypower/mpmaster/CrashHandler.java +++ b/mpmaster/src/main/java/com/xypower/mpmaster/CrashHandler.java @@ -157,7 +157,11 @@ public class CrashHandler implements Thread.UncaughtExceptionHandler { String time = mFormatter.format(new Date()); String fileName = "crash-" + time + ".log"; if (Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)) { - String path = MicroPhotoContext.buildMasterAppDir(MpMstApplication.getContext()) + "logs/"; + String appPath = MicroPhotoContext.buildMasterAppDir(MpMstApplication.getContext()); + if (appPath == null) { + appPath = "/sdcard/" + MicroPhotoContext.PACKAGE_NAME_MPMASTER + "/"; + } + String path = appPath + "logs/"; File dir = new File(path); if (!dir.exists()) { dir.mkdirs();