diff options
| author | Stefan Boberg <[email protected]> | 2021-05-21 16:20:01 +0200 |
|---|---|---|
| committer | Stefan Boberg <[email protected]> | 2021-05-21 16:20:01 +0200 |
| commit | cd04db3c2f2c0536b554316b73fe688584900bb7 (patch) | |
| tree | d29af333c2c1950154ea7a165afcd60f5d8d398b /zencore/uid.cpp | |
| parent | WIP structured cache endpoints - tactical check-in not fully functional yet (diff) | |
| download | zen-cd04db3c2f2c0536b554316b73fe688584900bb7.tar.xz zen-cd04db3c2f2c0536b554316b73fe688584900bb7.zip | |
Added Oid::operator bool for "null" checking
Diffstat (limited to 'zencore/uid.cpp')
| -rw-r--r-- | zencore/uid.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/zencore/uid.cpp b/zencore/uid.cpp index 9506b305c..347333445 100644 --- a/zencore/uid.cpp +++ b/zencore/uid.cpp @@ -143,9 +143,14 @@ Oid::FromHexString(const std::string_view String) Oid Id; - ParseHexBytes(String.data(), String.size(), reinterpret_cast<uint8_t*>(Id.OidBits)); - - return Id; + if (ParseHexBytes(String.data(), String.size(), reinterpret_cast<uint8_t*>(Id.OidBits))) + { + return Id; + } + else + { + return Oid::Zero; + } } StringBuilderBase& |