diff --git a/src/Trigger.php b/src/Trigger.php index 53f293f..f883bc9 100644 --- a/src/Trigger.php +++ b/src/Trigger.php @@ -24,6 +24,7 @@ use MySQLReplication\MySQLReplicationFactory; use ReflectionException; use ReflectionMethod; +use Throwable; class Trigger { @@ -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; + } } /**