From 0ff8040895e6354ec3b5d0338d574d8effe3cba6 Mon Sep 17 00:00:00 2001 From: Guus der Kinderen Date: Mon, 9 Nov 2020 16:20:02 +0100 Subject: [PATCH] FileTransfer: replace Error.none with null This fixes an inconsistent representation of a 'no error' representation, that causes a file transfer in which not enough bytes were transferred to _not_ be marked as having a problem. --- .../org/jivesoftware/smackx/filetransfer/FileTransfer.java | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/smack-extensions/src/main/java/org/jivesoftware/smackx/filetransfer/FileTransfer.java b/smack-extensions/src/main/java/org/jivesoftware/smackx/filetransfer/FileTransfer.java index 3d5c1c87a..c09e8ede0 100644 --- a/smack-extensions/src/main/java/org/jivesoftware/smackx/filetransfer/FileTransfer.java +++ b/smack-extensions/src/main/java/org/jivesoftware/smackx/filetransfer/FileTransfer.java @@ -215,7 +215,7 @@ public abstract class FileTransfer { } // the connection was likely terminated abruptly if these are not equal - if (!getStatus().equals(Status.cancelled) && getError() == Error.none + if (!getStatus().equals(Status.cancelled) && getError() == null && amountWritten != fileSize) { setStatus(Status.error); this.error = Error.connection; @@ -313,11 +313,6 @@ public abstract class FileTransfer { @SuppressWarnings("JavaLangClash") public enum Error { - /** - * No error. - */ - none("No error"), - /** * The peer did not find any of the provided stream mechanisms * acceptable.