diff options
author | George Hazan <ghazan@miranda.im> | 2017-07-02 17:00:21 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2017-07-02 17:00:21 +0300 |
commit | d26634309192836f214e3958510985ace75f984d (patch) | |
tree | 1eaf10493e469b5f829803bdda594883eb17061b /plugins/MirOTR | |
parent | 1153d92a13cd3c04e2203a1b2b15cfc42b2e52a0 (diff) |
fix for rare crash in mirOTR
Diffstat (limited to 'plugins/MirOTR')
-rw-r--r-- | plugins/MirOTR/src/utils.cpp | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/plugins/MirOTR/src/utils.cpp b/plugins/MirOTR/src/utils.cpp index 12d5d553ab..26b4f82bdf 100644 --- a/plugins/MirOTR/src/utils.cpp +++ b/plugins/MirOTR/src/utils.cpp @@ -44,14 +44,13 @@ TrustLevel otr_context_get_trust(ConnContext *context) TrustLevel level = TRUST_NOT_PRIVATE; if (context && context->msgstate == OTRL_MSGSTATE_ENCRYPTED) { - if (context->active_fingerprint->trust && context->active_fingerprint->trust[0]) { - level = TRUST_PRIVATE; - } else { - level = TRUST_UNVERIFIED; - } - } else if (context && context->msgstate == OTRL_MSGSTATE_FINISHED) { - level = TRUST_FINISHED; + level = TRUST_UNVERIFIED; + if (context->active_fingerprint) + if (context->active_fingerprint->trust && context->active_fingerprint->trust[0]) + level = TRUST_PRIVATE; } + else if (context && context->msgstate == OTRL_MSGSTATE_FINISHED) + level = TRUST_FINISHED; return level; } |