fix: guard null writes in SessionDriver::setSessionKey

This commit is contained in:
Joel Male
2026-05-27 20:53:19 +10:00
parent c9f48d7e88
commit 8927ef08a0
2 changed files with 18 additions and 2 deletions
+7 -2
View File
@@ -37,8 +37,13 @@ public function setSessionKey(string $sessionKey): void
$this->itemsKey = $sessionKey . '_cart_items';
$this->conditionsKey = $sessionKey . '_cart_conditions';
$this->session->put($this->itemsKey, $items);
$this->session->put($this->conditionsKey, $conditions);
if ($items !== null) {
$this->session->put($this->itemsKey, $items);
}
if ($conditions !== null) {
$this->session->put($this->conditionsKey, $conditions);
}
}
public function getDriverName(): string