Skip to content

Commit

Permalink
Merge pull request #1882 from profanity-im/fix/1880-pluginsinstall
Browse files Browse the repository at this point in the history
Don't crash when using `/plugins install` disconnected
  • Loading branch information
jubalh authored Aug 28, 2023
2 parents 65d62db + b881747 commit 8618203
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/tools/http_download.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
5 changes: 4 additions & 1 deletion src/tools/http_upload.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 8618203

Please sign in to comment.