Skip to content

A free open source IT asset/license management system

Exit early if no logs found

Marcus Moore6dd3ab2ec90f
diff --git a/app/Console/Commands/FixBulkAccessoryCheckinActionLogEntries.php b/app/Console/Commands/FixBulkAccessoryCheckinActionLogEntries.php
index 70d0a4460b..8879430c6b 100644
--- a/app/Console/Commands/FixBulkAccessoryCheckinActionLogEntries.php
+++ b/app/Console/Commands/FixBulkAccessoryCheckinActionLogEntries.php
@@ -41,6 +41,11 @@ class FixBulkAccessoryCheckinActionLogEntries extends Command
// Logs that were improperly timestamped should have created_at in the 1970s
$logs = Actionlog::whereYear('created_at', '1970')->get();
+ if ($logs->isEmpty()) {
+ $this->info('No logs found with incorrect timestamps.');
+ return 0;
+ }
+
$this->info('Found ' . $logs->count() . ' logs with incorrect timestamps:');
$this->table(