mirror of
https://github.com/LightZirconite/Microsoft-Rewards-Bot.git
synced 2026-01-09 09:06:15 +00:00
fix: Improve account search logic in disableBannedAccount function
This commit is contained in:
@@ -46,7 +46,7 @@ export async function disableBannedAccount(email: string, reason: string): Promi
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Find the account
|
// Find the account
|
||||||
const accountIndex = accountsArray.findIndex((acc: unknown) => acc.email === email)
|
const accountIndex = accountsArray.findIndex((acc: any) => acc && typeof acc === 'object' && acc.email === email)
|
||||||
if (accountIndex === -1) {
|
if (accountIndex === -1) {
|
||||||
throw new Error(`Account ${email} not found in accounts.jsonc`)
|
throw new Error(`Account ${email} not found in accounts.jsonc`)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user