From c35167f2f560232eb8084c775488e77e8c2e7d7f Mon Sep 17 00:00:00 2001 From: zadam Date: Sun, 3 Dec 2023 21:37:50 +0100 Subject: [PATCH] sometimes CPU info is not available #3957 --- src/www.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/www.js b/src/www.js index 1dc081befd..84f3abaa97 100644 --- a/src/www.js +++ b/src/www.js @@ -60,7 +60,9 @@ function startTrilium() { log.info(JSON.stringify(appInfo, null, 2)); const cpuInfos = require('os').cpus(); - log.info(`CPU model: ${cpuInfos[0].model}, logical cores: ${cpuInfos.length} freq: ${cpuInfos[0].speed} Mhz`); // for perf. issues it's good to know the rough configuration + if (cpuInfos && cpuInfos[0] !== undefined) { // https://github.com/zadam/trilium/pull/3957 + log.info(`CPU model: ${cpuInfos[0].model}, logical cores: ${cpuInfos.length} freq: ${cpuInfos[0].speed} Mhz`); // for perf. issues it's good to know the rough configuration + } const httpServer = startHttpServer();