1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2024-11-19 10:32:05 +01:00

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.
This commit is contained in:
Guus der Kinderen 2020-11-09 16:20:02 +01:00 committed by Florian Schmaus
parent e117f431bc
commit 0ff8040895

View file

@ -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.