do not act on input blank.

This commit is contained in:
fiatjaf
2023-03-25 14:42:28 -03:00
parent c2a826e854
commit b94219512f
2 changed files with 3 additions and 2 deletions

View File

@@ -12,7 +12,8 @@ type Result = Either[
]
object Parser {
def parseInput(input: String): Result =
def parseInput(input: String): Result = if input == "" then Left("")
else
ByteVector
.fromHex(input)
.flatMap(b => Try(Right(ByteVector32(b))).toOption)