fix: don't allow empty drawings to be uploaded

This commit is contained in:
trisua 2025-06-20 19:27:12 -04:00
parent 16843a6ab8
commit a4298f95f6
2 changed files with 5 additions and 0 deletions

View file

@ -415,6 +415,9 @@ impl DataManager {
// this is the initial iter to check sizes, we'll do uploads after
if drawing.len() > Self::MAXIMUM_DRAWING_SIZE {
return Err(Error::FileTooLarge);
} else if drawing.len() < 25 {
// if we have less than 25 bytes in a drawing, the drawing is likely blank
return Err(Error::FileTooSmall);
}
}