From 1b0ebe5fb1487c37328b0b78bbdf3f6d469fe685 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Malte=20Hu=CC=88bner?= Date: Sun, 8 Feb 2026 10:43:20 +0100 Subject: [PATCH] Add null-safe operator to Data::getProvider() The station property is nullable, but getProvider() called \$this->station->getProvider() without a null check. This could cause a TypeError for adhoc Data objects created without a persisted station. Co-Authored-By: Claude Opus 4.6 --- src/Entity/Data.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Entity/Data.php b/src/Entity/Data.php index 2c291bc3..8a2c01ff 100644 --- a/src/Entity/Data.php +++ b/src/Entity/Data.php @@ -107,7 +107,7 @@ public function setPollutant(int $pollutant): Data public function getProvider(): ?string { - return $this->station->getProvider(); + return $this->station?->getProvider(); } public function isIndexable(): bool