Guard settings access

This commit is contained in:
Nick O'Leary
2024-01-08 23:37:44 +00:00
parent 50627cd697
commit d876146ea5

View File

@@ -136,10 +136,12 @@ function start() {
.then(function() { return settings.load(storage)})
.then(function() { return library.init(runtime)})
.then(function() {
if (settings.available()) {
if (settings.get('instanceId') === undefined) {
settings.set('instanceId', crypto.randomBytes(8).toString('hex'))
}
userSettings.instanceId = settings.get('instanceId') || ''
}
if (log.metric()) {
runtimeMetricInterval = setInterval(function() {
reportMetrics();