Skip to content

Commit

Permalink
Merge pull request #991 from kuzzleio/fix-telemetry-make-app-crash
Browse files Browse the repository at this point in the history
Re-ask in case of corrupted telemetry cookie
  • Loading branch information
Aschen authored Aug 5, 2022
2 parents 4be3ad0 + 1ff9e13 commit b6d0b06
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/services/telemetryCookies.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@ export default {
get: () => {
const telemetrySetting = document.cookie.split('telemetry=')[1]
if (telemetrySetting !== undefined) {
return JSON.parse(telemetrySetting)
try {
return JSON.parse(telemetrySetting)
} catch (error) {
return null
}
}

return null
Expand Down

0 comments on commit b6d0b06

Please sign in to comment.