Skip to content

Commit f51cb15

Browse files
committed
check if log exists
1 parent 391221c commit f51cb15

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/Commands/UnblockIp.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@ public function handle()
4040
$now = Carbon::now(config('app.timezone'));
4141

4242
Ip::with('log')->blocked()->each(function ($ip) use ($now) {
43+
if (empty($ip->log)) {
44+
return;
45+
}
46+
4347
$period = config('firewall.middleware.' . $ip->log->middleware . '.auto_block.period');
4448

4549
if ($ip->created_at->addSeconds($period) > $now) {

0 commit comments

Comments
 (0)