[chore] fix sonarcloud issues

This commit is contained in:
MathieuG-P
2023-12-15 20:46:00 +01:00
parent c2ff4fed8b
commit cb6682d954
+2 -2
View File
@@ -22,9 +22,9 @@ export class SteamService {
public async getActiveUser(): Promise<number>{
const res = await list("HKCU\\Software\\Valve\\Steam\\ActiveProcess");
const key = res["HKCU\\Software\\Valve\\Steam\\ActiveProcess"];
if(!key.exists){ throw "Key \"HKCU\\Software\\Valve\\Steam\\ActiveProcess\" not exist"; }
if(!key.exists){ throw new Error("Key \"HKCU\\Software\\Valve\\Steam\\ActiveProcess\" not exist"); }
const registryValue = key.values.ActiveUser as RegDwordValue;
if(!registryValue){ throw "Value \"ActiveUser\" not exist"; }
if(!registryValue){ throw new Error("Value \"ActiveUser\" not exist"); }
return registryValue.value;
}