Skip to content

Commit e7ff95b

Browse files
Update src/api.ts
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 8295362 commit e7ff95b

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/api.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -889,8 +889,9 @@ export default class AppleiMessage implements PlatformAPI {
889889
}
890890

891891
case 'reaction-sticker': {
892-
const reactionRowID = Number.parseInt(methodName, 10)
893-
if (!Number.isFinite(reactionRowID)) throw new Error("invalid reaction sticker row ID")
892+
if (!/^\d+$/.test(methodName)) throw new Error("invalid reaction sticker row ID")
893+
const reactionRowID = Number(methodName)
894+
if (!Number.isSafeInteger(reactionRowID)) throw new Error("invalid reaction sticker row ID")
894895
const db = await this.ensureDB()
895896
const attachment = (await db.getAttachments([reactionRowID])).find(a => a.filePath)
896897
if (!attachment?.filePath) throw new Error("couldn't resolve sticker attachment for reaction row")

0 commit comments

Comments
 (0)