Skip to content

Commit

Permalink
+ check crash file exists
Browse files Browse the repository at this point in the history
  • Loading branch information
4ntoine committed Mar 20, 2014
1 parent 6f2e520 commit 8c92bc8
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/main/java/org/acra/collector/CrashReportDataFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,7 @@
import static org.acra.ACRA.LOG_TAG;
import static org.acra.ReportField.*;

import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.io.Writer;
import java.io.*;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
Expand Down Expand Up @@ -320,7 +316,12 @@ public CrashReportData createCrashData(Throwable th, boolean isSilentReport, Thr

// Application specific crash dump file
if (crashReportFields.contains(CRASH_DUMP)) {
crashReportData.put(CRASH_DUMP, ACRA.getConfig().crashDumpFile());

if (ACRA.getConfig().crashDumpFile() != null &&
new File(ACRA.getConfig().crashDumpFile()).exists())
crashReportData.put(CRASH_DUMP, ACRA.getConfig().crashDumpFile());
else
Log.w(ACRA.LOG_TAG, "Crash report dump file not found, skipping attachment");
}

// Application specific log file
Expand Down

0 comments on commit 8c92bc8

Please sign in to comment.