Skip to content

Commit 42c09b3

Browse files
committed
Add used data checks in api.
1 parent b1bd220 commit 42c09b3

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

src/common/api.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,11 @@ DECLARE_STATIC_LOGGER(logger, "api");
3636

3737
ptree api_call(const Remote &r, const String &api, ptree request)
3838
{
39+
if (r.user.empty())
40+
throw std::runtime_error("Remote user is empty");
41+
if (r.token.empty())
42+
throw std::runtime_error("Remote token is empty");
43+
3944
request.put("auth.user", r.user);
4045
request.put("auth.token", r.token);
4146

0 commit comments

Comments
 (0)