Skip to content

Commit

Permalink
Issue #3375315: check that $element is not NULL
Browse files Browse the repository at this point in the history
  • Loading branch information
herbdool authored Jul 18, 2023
1 parent 192a3ac commit 908515d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/WebformCivicrmPostProcess.php
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ protected function modifyWebformSubmissionData(WebformSubmissionInterface $webfo
$webform = $webform_submission->getWebform();
foreach ($data as $field_key => $val) {
$element = $webform->getElement($field_key);
if ($element['#type'] == 'civicrm_options' && is_array($val) && count(array_filter(array_keys($val), 'is_string')) > 0) {
if ($element && $element['#type'] == 'civicrm_options' && is_array($val) && count(array_filter(array_keys($val), 'is_string')) > 0) {
$data[$field_key] = array_values($val);
}
}
Expand Down

0 comments on commit 908515d

Please sign in to comment.