Making a request such as GET /api/v1/players/ will result in 500 Internal Server Error (Code 50003) response. This is due to the code trying to determine the extremal IDs assuming that at least one non-null row is returned from the database. If the table in question is empty however, the database will return NULL, and we get ColumnDecode { index: "0", source: UnexpectedNullError }
Fix would be to either return 404 or an empty response with no Links header set (we only need the min/max to determine the "first" and "last" links used for pagination)
Making a request such as
GET /api/v1/players/
will result in 500 Internal Server Error (Code 50003) response. This is due to the code trying to determine the extremal IDs assuming that at least one non-null row is returned from the database. If the table in question is empty however, the database will returnNULL
, and we getColumnDecode { index: "0", source: UnexpectedNullError }
https://github.com/stadust/pointercrate/blob/d63f42e5be36f91b7a6fe44968033189f5cb7ef9/pointercrate-demonlist/src/player/mod.rs#L82-L86