Skip to content

Commit

Permalink
Added option to ignore service if not available.
Browse files Browse the repository at this point in the history
  • Loading branch information
MdNadimHossain committed Nov 13, 2024
1 parent 4dbcef4 commit e7e8ce2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
10 changes: 6 additions & 4 deletions src/TideSystemInfoService.php
Original file line number Diff line number Diff line change
Expand Up @@ -226,10 +226,12 @@ function ($entityType) {
*/
public function getPackageVersion($packageName) {
if (empty($packageName)) {
$result = $this->sensorRunner->runSensors([SensorConfig::load('tide_times')]);
$value = $result[0]->getValue();
$decodedValue = json_decode($value, TRUE);
return $decodedValue;
if ($this->sensorRunner) {
$result = $this->sensorRunner->runSensors([SensorConfig::load('tide_times')]);
$value = $result[0]->getValue();
$decodedValue = json_decode($value, TRUE);
return $decodedValue;
}
}

if (strtolower($packageName) === 'php') {
Expand Down
2 changes: 1 addition & 1 deletion tide_core.services.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@ services:
- '@entity_field.manager'
- '@logger.factory'
- '@file_system'
- '@monitoring.sensor_runner'
- '@?monitoring.sensor_runner'

0 comments on commit e7e8ce2

Please sign in to comment.