From f39b0977b72b1d35d730925538d04bb09418ec3f Mon Sep 17 00:00:00 2001 From: Cory McWilliams Date: Tue, 9 Dec 2025 21:33:03 -0500 Subject: [PATCH] build: Fix. --- src/api.js.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/api.js.c b/src/api.js.c index fd9a8e33..35265813 100644 --- a/src/api.js.c +++ b/src/api.js.c @@ -1202,7 +1202,14 @@ static JSValue _tf_ssb_swap_with_server_identity(JSContext* context, JSValueCons *work = (swap_with_server_identity_t) { 0 }; tf_ssb_whoami(ssb, work->server_id, sizeof(work->server_id)); tf_string_set(work->user_id, sizeof(work->user_id), id); - memcpy(work->user, user, user_length + 1); + if (user) + { + memcpy(work->user, user, user_length + 1); + } + else + { + *work->user = '\0'; + } JSValue result = JS_NewPromiseCapability(context, work->promise); char description[1024]; snprintf(description, sizeof(description), "Swap identity %s with %s.", work->user_id, work->server_id);