fix: was incorrectly getting roles/id's from null
This commit is contained in:
parent
6a0b664e7d
commit
70690f712e
1 changed files with 20 additions and 4 deletions
16
src/lib.rs
16
src/lib.rs
|
@ -136,8 +136,12 @@ impl<'r> FromRow<'r, SqliteRow> for ServerMembersWolves {
|
|||
let discord = match row.try_get("discord") {
|
||||
Ok(x) => {
|
||||
let tmp: i64 = x;
|
||||
if tmp == 0 {
|
||||
None
|
||||
} else {
|
||||
Some(UserId::from(tmp as u64))
|
||||
}
|
||||
}
|
||||
_ => None,
|
||||
};
|
||||
|
||||
|
@ -164,8 +168,12 @@ impl<'r> FromRow<'r, SqliteRow> for Wolves {
|
|||
let discord = match row.try_get("discord") {
|
||||
Ok(x) => {
|
||||
let tmp: i64 = x;
|
||||
if tmp == 0 {
|
||||
None
|
||||
} else {
|
||||
Some(UserId::from(tmp as u64))
|
||||
}
|
||||
}
|
||||
_ => None,
|
||||
};
|
||||
|
||||
|
@ -215,15 +223,23 @@ impl<'r> FromRow<'r, SqliteRow> for Servers {
|
|||
let role_past = match row.try_get("role_past") {
|
||||
Ok(x) => {
|
||||
let tmp: i64 = x;
|
||||
if tmp == 0 {
|
||||
None
|
||||
} else {
|
||||
Some(RoleId::from(tmp as u64))
|
||||
}
|
||||
}
|
||||
_ => None,
|
||||
};
|
||||
let role_current = match row.try_get("role_current") {
|
||||
Ok(x) => {
|
||||
let tmp: i64 = x;
|
||||
if tmp == 0 {
|
||||
None
|
||||
} else {
|
||||
Some(RoleId::from(tmp as u64))
|
||||
}
|
||||
}
|
||||
_ => None,
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue