1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-06-16 21:35:24 +00:00

Merge pull request #1882 from profanity-im/fix/1880-pluginsinstall

Don't crash when using `/plugins install` disconnected
This commit is contained in:
Michael Vetter 2023-08-28 10:00:54 +02:00 committed by GitHub
commit 8618203988
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 2 deletions

View File

@ -134,7 +134,10 @@ http_file_get(void* userdata)
gchar* cert_path = prefs_get_string(PREF_TLS_CERTPATH);
gchar* cafile = cafile_get_name();
ProfAccount* account = accounts_get_account(session_get_account_name());
gboolean insecure = account->tls_policy && strcmp(account->tls_policy, "trust") == 0;
gboolean insecure = FALSE;
if (account) {
insecure = account->tls_policy && strcmp(account->tls_policy, "trust") == 0;
}
account_free(account);
pthread_mutex_unlock(&lock);

View File

@ -186,8 +186,11 @@ http_file_put(void* userdata)
auto_gchar gchar* cert_path = prefs_get_string(PREF_TLS_CERTPATH);
gchar* cafile = cafile_get_name();
gboolean insecure = FALSE;
ProfAccount* account = accounts_get_account(session_get_account_name());
gboolean insecure = account->tls_policy && strcmp(account->tls_policy, "trust") == 0;
if (account) {
insecure = account->tls_policy && strcmp(account->tls_policy, "trust") == 0;
}
account_free(account);
pthread_mutex_unlock(&lock);