diff options
author | Daniel Gultsch <daniel@gultsch.de> | 2015-08-11 16:50:00 +0200 |
---|---|---|
committer | Daniel Gultsch <daniel@gultsch.de> | 2015-08-11 16:50:00 +0200 |
commit | dad90762b44878a436479a3998fec45111c9af46 (patch) | |
tree | fe79357af8b05a691f7c2c1f9f39fe2c78b02510 /src/main/java/eu/siacs/conversations/http/HttpUploadConnection.java | |
parent | 3677c6ec985f4b10d4d0c6a75c88973b2917ad4e (diff) |
do not touch pictures that are already in the right format
fixed #522
Diffstat (limited to 'src/main/java/eu/siacs/conversations/http/HttpUploadConnection.java')
-rw-r--r-- | src/main/java/eu/siacs/conversations/http/HttpUploadConnection.java | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/main/java/eu/siacs/conversations/http/HttpUploadConnection.java b/src/main/java/eu/siacs/conversations/http/HttpUploadConnection.java index 69e9212e..2e545842 100644 --- a/src/main/java/eu/siacs/conversations/http/HttpUploadConnection.java +++ b/src/main/java/eu/siacs/conversations/http/HttpUploadConnection.java @@ -7,6 +7,7 @@ import android.os.PowerManager; import android.util.Log; import android.util.Pair; +import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; @@ -104,7 +105,13 @@ public class HttpUploadConnection implements Transferable { mXmppConnectionService.getRNG().nextBytes(this.key); this.file.setKeyAndIv(this.key); } - Pair<InputStream,Integer> pair = AbstractConnectionManager.createInputStream(file,true); + Pair<InputStream,Integer> pair; + try { + pair = AbstractConnectionManager.createInputStream(file, true); + } catch (FileNotFoundException e) { + fail(); + return; + } this.file.setExpectedSize(pair.second); this.mFileInputStream = pair.first; Jid host = account.getXmppConnection().findDiscoItemByFeature(Xmlns.HTTP_UPLOAD); |