mirror of
https://github.com/xCyanGrizzly/DragonsStash.git
synced 2026-07-22 23:12:02 +00:00
harden(telegram): reject non-positive topic id in disableActiveTopic
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
BigInt("") / BigInt("0") don't throw; guard against them since the
action is exported and admin-callable independent of the UI button.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -482,6 +482,11 @@ export async function disableActiveTopic(
|
||||
} catch {
|
||||
return { success: false, error: "Invalid topic id" };
|
||||
}
|
||||
// BigInt("") / BigInt("0") don't throw — reject non-positive ids explicitly
|
||||
// since this action is exported and admin-callable outside the UI button.
|
||||
if (topicIdBig <= BigInt(0)) {
|
||||
return { success: false, error: "Invalid topic id" };
|
||||
}
|
||||
|
||||
try {
|
||||
await prisma.topicProgress.upsert({
|
||||
|
||||
Reference in New Issue
Block a user