Fix null UUIDs

This commit is contained in:
zontreck 2024-05-16 23:11:30 -07:00
parent 1024c4dbd7
commit 960cf0d789
3 changed files with 9 additions and 2 deletions

View file

@ -89,7 +89,7 @@ class UUID {
factory UUID.generate(int version, {List<Object>? parameters}) {
List<Object> params = [];
if (parameters == null) {
if (version != 4) {
if (version != 4 && version != 0) {
return UUID.generate(4);
}
} else {

View file

@ -1,6 +1,6 @@
name: libac_flutter
description: "Aria's Creations code library"
version: 1.0.4
version: 1.0.5
homepage: "https://zontreck.com"
environment:

View file

@ -75,4 +75,11 @@ void main() {
expect(ID3.toString(), asString);
});
test("Null UUID", () {
var expected = "00000000-0000-0000-0000-000000000000";
var actual = UUID.ZERO.toString();
expect(actual, expected);
});
}