Trim spaces in UUIDs

This commit is contained in:
Foti Dim
2024-07-15 11:53:00 +02:00
parent efaa72acbd
commit c0c678c735
4 changed files with 12 additions and 1 deletions
+1
View File
@@ -4,6 +4,7 @@ class BleUuidParser {
/// Parse a string to a valid 128-bit UUID.
/// Throws `FormatException` if the string does not hold a valid UUID format.
static String string(String uuid) {
uuid = uuid.trim();
if (uuid.length < 4) {
throw const FormatException('Invalid UUID');
}