Skip to content

Commit

Permalink
fix object access if not exists
Browse files Browse the repository at this point in the history
  • Loading branch information
nadar committed Aug 6, 2019
1 parent 54e1827 commit 39dceff
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/adapters/SentryAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -151,17 +151,16 @@ public function generateStackTraceFrames(Data $data)
public function generateContext(Data $data)
{
$contexts = [];
// os

if ($data->getWhichBrowser()) {
// os
$contexts['os'] = [
'version' => $data->getWhichBrowser()->os->version->value,
'name' => $data->getWhichBrowser()->os->name,
'type' => 'os',
];
}

// browser
if ($data->getWhichBrowser()->browser->name) {
// browser
$contexts['browser'] = [
'version' => $data->getWhichBrowser()->browser->version->value,
'name' => $data->getWhichBrowser()->browser->name,
Expand Down

0 comments on commit 39dceff

Please sign in to comment.