From a9fafa8fdca8c390f6a43f6ce77fee12ffd06e0d Mon Sep 17 00:00:00 2001 From: shockrah Date: Mon, 16 Nov 2020 22:56:56 -0800 Subject: [PATCH] casting to avoid calamity with signedness memes --- server-api/db/src/invites.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/server-api/db/src/invites.rs b/server-api/db/src/invites.rs index b64d58a..6cb2de6 100644 --- a/server-api/db/src/invites.rs +++ b/server-api/db/src/invites.rs @@ -20,6 +20,9 @@ impl FromDB for Invite { type Row = Option<(BigInt, Option, bool)>; async fn get(p: &Pool, id: UBigInt) -> Response { + // NOTE: cast is required for this as `id` is used as unix timestamp + let id: BigInt = id as BigInt; + if id <= 0 { return Response::Empty; }