Replace strUnHex pair return type with optional<Blob>

This commit is contained in:
seelabs
2019-08-14 13:13:45 -07:00
parent 7912ee6f7b
commit 0a256247a0
13 changed files with 48 additions and 47 deletions

View File

@@ -428,9 +428,9 @@ isMemoOkay (STObject const& st, std::string& reason)
}
// The raw data is stored as hex-octets, which we want to decode.
auto [data, validData] = strUnHex (memoElement.getText ());
auto optData = strUnHex (memoElement.getText ());
if (!validData)
if (!optData)
{
reason = "The MemoType, MemoData and MemoFormat fields may "
"only contain hex-encoded data.";
@@ -459,7 +459,7 @@ isMemoOkay (STObject const& st, std::string& reason)
return a;
}();
for (auto c : data)
for (auto c : *optData)
{
if (!allowedSymbols[c])
{