diff --git a/web/app/Sensor/Updates.php b/web/app/Sensor/Updates.php index 578fb442e7c4966845af0755069e46c97fe98a2a..86928e613da0d1c909dbaac6838754d44455524a 100644 --- a/web/app/Sensor/Updates.php +++ b/web/app/Sensor/Updates.php @@ -33,6 +33,10 @@ class Updates extends \App\AbstractSensor { } $status = $this->parse($record->updates); + if ($status == null) { + return self::STATUS_UNKNOWN; + } + if ($status["security"] != 0) { return self::STATUS_WARNING; } @@ -42,7 +46,10 @@ class Updates extends \App\AbstractSensor { public function parse($string) { $matches = []; - preg_match(self::REGEXP, $string, $matches); + if (!preg_match(self::REGEXP, $string, $matches)) { + return null; + } + $result["updates"] = $matches[1]; $result["security"] = $matches[2]; return $result;