Skip to content

Commit 771c9d2

Browse files
committed
always reset crash report exception origins + remove count
1 parent 51b075b commit 771c9d2

1 file changed

Lines changed: 5 additions & 12 deletions

File tree

‎src/Console/Command/CrashReport/FixCrashReportExceptionOriginsCommand.php‎

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,13 @@ protected function execute(Input $input, Output $output)
4646
return Command::INVALID;
4747
}
4848

49-
$reports_updated = 0;
50-
5149
// Loop trough all workshop items
5250
/** @var CrashReport $report */
5351
foreach ($crash_reports as $crash_report) {
5452

53+
// Reset exception source function
54+
$crash_report->setExceptionSourceFunction(null);
55+
5556
$game_log = $crash_report->getGameLog();
5657
if (empty($game_log)) {
5758
continue;
@@ -61,21 +62,13 @@ protected function execute(Input $input, Output $output)
6162
$exception_source_function = $matches[1] ?? null;
6263
if (!empty($exception_source_function)) {
6364
$crash_report->setExceptionSourceFunction($exception_source_function);
64-
$output->writeln("[+] {$crash_report->getId()} -> {$exception_source_function}");
65-
$reports_updated++;
65+
$output->writeln("[+] #{$crash_report->getId()} -> {$exception_source_function}");
6666
}
6767
}
6868
}
6969

7070
// Save changes to DB
71-
if ($reports_updated > 0) {
72-
$em->flush();
73-
}
74-
75-
// Show output
76-
if ($reports_updated > 0) {
77-
$output->writeln("[+] <info>{$reports_updated}</info> crash reports updated!");
78-
}
71+
$em->flush();
7972

8073
// Success
8174
$output->writeln("[+] Done!");

0 commit comments

Comments
 (0)