fix: Error Cannot read properties of undefined (reading 'sendTelemetry') (#3734)

fix Error: Cannot read properties of undefined (reading 'sendTelemetry')
This commit is contained in:
Karlo Benčić 2024-12-21 02:09:45 +01:00 committed by GitHub
parent bbe0203f4e
commit e8a33e4d4d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 5 additions and 1 deletions

View File

@ -2,7 +2,11 @@ import * as Server from '../index'
export const getRunningExpressApp = function () {
const runningExpressInstance = Server.getInstance()
if (typeof runningExpressInstance === 'undefined' || typeof runningExpressInstance.nodesPool === 'undefined') {
if (
typeof runningExpressInstance === 'undefined' ||
typeof runningExpressInstance.nodesPool === 'undefined' ||
typeof runningExpressInstance.telemetry === 'undefined'
) {
throw new Error(`Error: getRunningExpressApp failed!`)
}
return runningExpressInstance