Skip to content

Commit

Permalink
BinLogCurrent object has changed format - catch Throwable in unserial…
Browse files Browse the repository at this point in the history
…ize and clearCurrent (#14)
  • Loading branch information
cyppe authored Jun 6, 2024
1 parent 155c7e1 commit 4890206
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/Trigger.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
use MySQLReplication\MySQLReplicationFactory;
use ReflectionException;
use ReflectionMethod;
use Throwable;

class Trigger
{
Expand Down Expand Up @@ -200,7 +201,12 @@ public function getCurrent(): ?BinLogCurrent
return null;
}

return unserialize($cache) ?: null;
try {
return unserialize($cache);
} catch (Throwable $e) {
$this->clearCurrent();
return null;
}
}

/**
Expand Down

0 comments on commit 4890206

Please sign in to comment.