From 642e8f0df24a1b52744880f5bfa40d9e92e51d95 Mon Sep 17 00:00:00 2001 From: Eric Skogen Date: Tue, 16 Feb 2021 15:43:04 -0600 Subject: [PATCH] fix analytics for apple silicon allow os.cpus() to be an empty array --- src/js/analytics.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/js/analytics.js b/src/js/analytics.js index b5a079c5d8..0a8cc637b2 100644 --- a/src/js/analytics.js +++ b/src/js/analytics.js @@ -60,7 +60,8 @@ const init = shouldEnable => { cd4: os.release(), cd5: os.totalmem(), cd6: os.cpus().length, - cd7: os.cpus()[0].speed, + // Apple Silicon does not report os.cpus() in Electron 11 + cd7: os.cpus()[0]?.speed, }, uuid) .catch(_handleError) })