Fix crash on ACME automations (#3752)

This commit is contained in:
Greg Glockner
2024-01-09 17:25:05 +01:00
committed by GitHub
parent 5f3092d02f
commit d92bb27d87
@@ -598,10 +598,14 @@ class LeCertificate extends LeCommon
foreach ($automations as $auto_uuid) {
$autoFactory = new LeAutomationFactory();
$automation = $autoFactory->getAutomation($auto_uuid);
$automation->init($this->getId(), (string)$this->config->name, (string)$this->config->account, $this->cert_ecc);
// Ignore invalid automations.
if ($automation->prepare()) {
$automation->run();
// Skip invalid automations.
if (!is_null($automation)) {
$automation->init($this->getId(), (string)$this->config->name, (string)$this->config->account, $this->cert_ecc);
if ($automation->prepare()) {
$automation->run();
}
} else {
LeUtils::log_error("ignoring invalid automation: ${auto_uuid}");
}
}