Skip to content

Commit 33f26ee

Browse files
committed
fix: correctly handle empty weak_typed_id (#13)
1 parent 6225b53 commit 33f26ee

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/meta_process.hpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,9 @@ namespace fb2k_ncm
6565
if (json.is_number_integer()) {
6666
n_ = json.get<uint64_t>();
6767
} else if (json.is_string()) {
68-
n_ = std::stoull(json.get<std::string>());
68+
if (auto &&s = json.get<std::string>(); !s.empty()) {
69+
n_ = std::stoull(s);
70+
}
6971
}
7072
}
7173
explicit weak_typed_id(const std::string &s) : n_(0) {

0 commit comments

Comments
 (0)