Skip to content

Commit

Permalink
check $schema for null value
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnRDOrazio committed Nov 19, 2024
1 parent 1ca404c commit 50e6225
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/Health.php
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,13 @@ private function executeValidation(object $validation, ConnectionInterface $to)
{
$dataPath = $validation->sourceFile;
$schema = Health::retrieveSchemaForCategory($validation->category, $dataPath);
if (null === $schema) {
$message = new \stdClass();
$message->type = "error";
$message->text = "Unable to detect schema for dataPath {$dataPath} and category {$validation->category}";
$message->classes = ".$validation->validate.schema-valid";
$this->sendMessage($to, $message);
}
$data = file_get_contents($dataPath);
if ($data !== false) {
$message = new \stdClass();
Expand Down

0 comments on commit 50e6225

Please sign in to comment.