prevent throwing on no error in lokinet-vpn

This commit is contained in:
Jeff Becker 2022-11-02 15:42:49 -04:00
parent 0bb58b4ac0
commit 0cf637178d
No known key found for this signature in database
GPG Key ID: 025C02EE3A092F2D
1 changed files with 3 additions and 2 deletions

View File

@ -241,9 +241,10 @@ main(int argc, char* argv[])
if (not maybe_result) if (not maybe_result)
return exit_error("could not add exit"); return exit_error("could not add exit");
if (auto err_it = maybe_result->find("error"); err_it != maybe_result->end()) if (auto err_it = maybe_result->find("error");
err_it != maybe_result->end() and not err_it.value().is_null())
{ {
return exit_error("{}", err_it->get<std::string_view>()); return exit_error("{}", err_it.value());
} }
} }
if (goDown) if (goDown)