bugfix: don't crash if aes key could not be set before jingle transfer

Daniel Gultsch created

Change summary

src/main/java/eu/siacs/conversations/xmpp/jingle/JingleConnection.java | 5 
1 file changed, 4 insertions(+), 1 deletion(-)

Detailed changes

src/main/java/eu/siacs/conversations/xmpp/jingle/JingleConnection.java 🔗

@@ -368,7 +368,10 @@ public class JingleConnection implements Transferable {
 					message, false);
 			if (message.getEncryption() == Message.ENCRYPTION_OTR) {
 				Conversation conversation = this.message.getConversation();
-				this.mXmppConnectionService.renewSymmetricKey(conversation);
+				if (!this.mXmppConnectionService.renewSymmetricKey(conversation)) {
+					Log.d(Config.LOGTAG,account.getJid().toBareJid()+": could not set symmetric key");
+					cancel();
+				}
 				content.setFileOffer(this.file, true);
 				this.file.setKey(conversation.getSymmetricKey());
 			} else {