From bd48b69345aded8d778e4c358d30995d38b59140 Mon Sep 17 00:00:00 2001 From: NguyenTranHoangSym <97150869+NguyenTranHoangSym@users.noreply.github.com> Date: Fri, 21 Jul 2023 15:40:07 +0700 Subject: [PATCH] SDA-4242: Local will take prio if invalid value inserted into HKCU (#1906) --- src/app/registry-handler.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/app/registry-handler.ts b/src/app/registry-handler.ts index 02d55387..5a56eb24 100644 --- a/src/app/registry-handler.ts +++ b/src/app/registry-handler.ts @@ -1,5 +1,5 @@ import { logger } from '../common/logger'; -import { RegistryStore } from './stores/registry-store'; +import { EChannelRegistry, RegistryStore } from './stores/registry-store'; enum RegistryValueType { REG_SZ = 'REG_SZ', @@ -44,7 +44,12 @@ export const retrieveWindowsRegistry = async (): Promise => { return new Promise((resolve) => { regKeyUser.get(CHANNEL_KEY, (error, channel) => { - if (error || !channel) { + if ( + error || + ![EChannelRegistry.BETA, EChannelRegistry.LATEST].includes( + channel?.value, + ) + ) { logger.error('registry-handler: error occurred. Details: ', error); regKeyLocal.get(CHANNEL_KEY, (err, localChannel) => {