From 46359fb12775e8d111258ca0cdf874af24a7cbd2 Mon Sep 17 00:00:00 2001 From: Chirag Chhatrala <60499540+chiragchhatrala@users.noreply.github.com> Date: Thu, 24 Oct 2024 15:32:23 +0530 Subject: [PATCH] fix undefined error on integrations (#601) --- api/app/Integrations/Handlers/EmailIntegration.php | 6 +++--- .../open/integrations/components/IntegrationCard.vue | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/api/app/Integrations/Handlers/EmailIntegration.php b/api/app/Integrations/Handlers/EmailIntegration.php index d425c3456..977e8e01f 100644 --- a/api/app/Integrations/Handlers/EmailIntegration.php +++ b/api/app/Integrations/Handlers/EmailIntegration.php @@ -28,7 +28,7 @@ public static function getValidationRules(): array 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 @@ public function handle(): void 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)) diff --git a/client/components/open/integrations/components/IntegrationCard.vue b/client/components/open/integrations/components/IntegrationCard.vue index 05dfacd35..43a76f148 100644 --- a/client/components/open/integrations/components/IntegrationCard.vue +++ b/client/components/open/integrations/components/IntegrationCard.vue @@ -203,7 +203,7 @@ const showIntegrationEventsModal = ref(false) const loadingDelete = ref(false) const actionsComponent = computed(() => { - if(integrationTypeInfo.value.actions_file_name) { + if(integrationTypeInfo.value?.actions_file_name || false) { return resolveComponent(integrationTypeInfo.value.actions_file_name) }