Merge pull request #1491 from ailin-nemui/serveradd-crash

stop crash on server add
This commit is contained in:
ailin-nemui 2023-08-26 17:11:38 +00:00 committed by GitHub
commit 58ca3af360
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -101,6 +101,12 @@ static SERVER_SETUP_REC *create_server_setup(GHashTable *optlist)
} }
} }
if (rec == NULL) {
/* no protocols loaded, bail out */
signal_emit("chat protocol unknown", 1, "(none)");
return NULL;
}
server = rec->create_server_setup(); server = rec->create_server_setup();
server->chat_type = rec->id; server->chat_type = rec->id;
server->tls_verify = TRUE; server->tls_verify = TRUE;