fix undefined error on integrations (#601)

This commit is contained in:
Chirag Chhatrala
2024-10-24 15:32:23 +05:30
committed by GitHub
parent 8a1282f4b0
commit 46359fb127
2 changed files with 4 additions and 4 deletions

View File

@@ -28,7 +28,7 @@ class EmailIntegration extends AbstractEmailIntegrationHandler
protected function shouldRun(): bool
{
return $this->integrationData->send_to && parent::shouldRun() && !$this->riskLimitReached();
return $this->integrationData?->send_to && parent::shouldRun() && !$this->riskLimitReached();
}
// To avoid phishing abuse we limit this feature for risky users
@@ -57,10 +57,10 @@ class EmailIntegration extends AbstractEmailIntegrationHandler
if ($this->form->is_pro) { // For Send to field Mentions are Pro feature
$formatter = (new FormSubmissionFormatter($this->form, $this->submissionData))->outputStringsOnly();
$parser = new MentionParser($this->integrationData->send_to, $formatter->getFieldsWithValue());
$parser = new MentionParser($this->integrationData?->send_to, $formatter->getFieldsWithValue());
$sendTo = $parser->parse();
} else {
$sendTo = $this->integrationData->send_to;
$sendTo = $this->integrationData?->send_to;
}
$recipients = collect(preg_split("/\r\n|\n|\r/", $sendTo))