From d26634309192836f214e3958510985ace75f984d Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sun, 2 Jul 2017 17:00:21 +0300 Subject: fix for rare crash in mirOTR --- plugins/MirOTR/src/utils.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'plugins/MirOTR') 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; } -- cgit v1.2.3