Skip to content

Commit

Permalink
Session::getAll() may return null
Browse files Browse the repository at this point in the history
I experienced an error when i cleared the website cookie: in this case `SilverStripe\Control\Session::getAll()` is returning `null` and not an empty array (which would be a nice suggestion to ss-repo), thus leading to a foreach-loop error.
  • Loading branch information
pine3ree authored and robbieaverill committed Nov 16, 2018
1 parent 361d28e commit 7058480
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions code/Collector/SilverStripeCollector.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,11 @@ public static function getCookieData()
public static function getSessionData()
{
$data = DebugBar::getRequest()->getSession()->getAll();

if (empty($data)) {
return [];
}

$filtered = [];

// Filter not useful data
Expand Down

0 comments on commit 7058480

Please sign in to comment.