summaryrefslogtreecommitdiff
path: root/collaboration.cpp
diff options
context:
space:
mode:
authorJosh Ferrell <josh@vector35.com>2024-06-12 12:11:55 -0400
committerJosh Ferrell <josh@vector35.com>2024-06-12 12:11:55 -0400
commit1415c07691ffb541d1aac162265e9a9b6affa713 (patch)
treed274ada141984d969e6717aa501ceca4b3792ec3 /collaboration.cpp
parent7c0514bb74642c87f0282e39c211befd3a20fc3c (diff)
Prevent crash when failing to authenticate with remote
Diffstat (limited to 'collaboration.cpp')
-rw-r--r--collaboration.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/collaboration.cpp b/collaboration.cpp
index b4f7d659..f99409a7 100644
--- a/collaboration.cpp
+++ b/collaboration.cpp
@@ -700,6 +700,8 @@ bool Remote::LoadMetadata()
std::string Remote::RequestAuthenticationToken(const std::string& username, const std::string& password)
{
char* token = BNRemoteRequestAuthenticationToken(m_object, username.c_str(), password.c_str());
+ if (token == nullptr)
+ throw RemoteException("Failed to authenticate");
std::string result = token;
BNFreeString(token);
return result;