对路径做保护

hdrplus
Matthew 11 months ago
parent 43a33d9e78
commit fad7f20ed1

@ -157,7 +157,11 @@ public class CrashHandler implements Thread.UncaughtExceptionHandler {
String time = mFormatter.format(new Date()); String time = mFormatter.format(new Date());
String fileName = "crash-" + time + ".log"; String fileName = "crash-" + time + ".log";
if (Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)) { 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); File dir = new File(path);
if (!dir.exists()) { if (!dir.exists()) {
dir.mkdirs(); dir.mkdirs();

Loading…
Cancel
Save