fix: improve input conversion logic in BaseBytes component (#11562)

This commit is contained in:
Arjun Porwal 2025-05-19 09:51:43 +05:30 committed by GitHub
parent cf6755806f
commit 3498973e65
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -48,7 +48,7 @@ function convertInput (value: string): [boolean, boolean, Uint8Array] {
return [true, false, new Uint8Array([])];
} else if (value.startsWith('0x')) {
try {
return [true, false, hexToU8a(value)];
return [true, false, isHex(value) ? hexToU8a(value) : stringToU8a(value)];
} catch {
return [false, false, new Uint8Array([])];
}