Skip to content

Commit

Permalink
SDA-4242: Local will take prio if invalid value inserted into HKCU (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
NguyenTranHoangSym committed Jul 21, 2023
1 parent f8ac374 commit a68573d
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/app/registry-handler.ts
Original file line number Diff line number Diff line change
@@ -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',
Expand Down Expand Up @@ -44,7 +44,12 @@ export const retrieveWindowsRegistry = async (): Promise<string> => {

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) => {
Expand Down

0 comments on commit a68573d

Please sign in to comment.