mirror of
https://github.com/wearepixel/laravel-cart.git
synced 2026-11-14 13:51:44 +00:00
fix: guard null writes in SessionDriver::setSessionKey
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user