Skip to content

Commit

Permalink
Made changes in proccessJSONfield to ensure null argument isnt provided
Browse files Browse the repository at this point in the history
  • Loading branch information
SHU8HAM1 committed Jan 9, 2025
1 parent 898f662 commit 0ce9456
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/Plugin/search_api/processor/JSONFieldProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -143,10 +143,15 @@ private function processJsonField($entity, ItemInterface $item, $field_name, $js
$json_data = $entity->get($json_field)->value;
if ($json_data === null) {
return;
} else{
$data = json_decode($json_data, true);
}
$data = json_decode($json_data, true);
$result = JmesPath::search($json_path, $data);

if ($result === null) {
return;
}

if (is_array($result)) {
$result = $this->flattenJson($result);
}
Expand Down

0 comments on commit 0ce9456

Please sign in to comment.