summaryrefslogtreecommitdiff
path: root/Userland/Services/SQLServer/ConnectionFromClient.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Userland/Services/SQLServer/ConnectionFromClient.cpp')
-rw-r--r--Userland/Services/SQLServer/ConnectionFromClient.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/Userland/Services/SQLServer/ConnectionFromClient.cpp b/Userland/Services/SQLServer/ConnectionFromClient.cpp
index 95d54622da..3c358dd9ae 100644
--- a/Userland/Services/SQLServer/ConnectionFromClient.cpp
+++ b/Userland/Services/SQLServer/ConnectionFromClient.cpp
@@ -37,8 +37,10 @@ void ConnectionFromClient::die()
Messages::SQLServer::ConnectResponse ConnectionFromClient::connect(DeprecatedString const& database_name)
{
dbgln_if(SQLSERVER_DEBUG, "ConnectionFromClient::connect(database_name: {})", database_name);
- auto database_connection = DatabaseConnection::construct(database_name, client_id());
- return { database_connection->connection_id() };
+
+ if (auto database_connection = DatabaseConnection::create(database_name, client_id()); !database_connection.is_error())
+ return { database_connection.value()->connection_id() };
+ return { {} };
}
void ConnectionFromClient::disconnect(u64 connection_id)