From e5879a1ce8b7551e03d5527147aa906ed20a1bcb Mon Sep 17 00:00:00 2001 From: Christian Schneppe Date: Sun, 17 Jul 2016 15:45:32 +0200 Subject: avoid NPE --- src/main/java/eu/siacs/conversations/http/HttpUploadConnection.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/main') diff --git a/src/main/java/eu/siacs/conversations/http/HttpUploadConnection.java b/src/main/java/eu/siacs/conversations/http/HttpUploadConnection.java index 2bd22fd1b..72ab6db46 100644 --- a/src/main/java/eu/siacs/conversations/http/HttpUploadConnection.java +++ b/src/main/java/eu/siacs/conversations/http/HttpUploadConnection.java @@ -118,8 +118,10 @@ public class HttpUploadConnection implements Transferable { fail(); return; } - this.file.setExpectedSize(pair.second); - this.mFileInputStream = pair.first; + if (pair != null) { + this.file.setExpectedSize(pair.second); + this.mFileInputStream = pair.first; + } Jid host = account.getXmppConnection().findDiscoItemByFeature(Xmlns.HTTP_UPLOAD); IqPacket request = mXmppConnectionService.getIqGenerator().requestHttpUploadSlot(host,file,mime); mXmppConnectionService.sendIqPacket(account, request, new OnIqPacketReceived() { -- cgit v1.2.3