1
0
Fork 0
mirror of https://codeberg.org/Mercury-IM/Smack synced 2024-11-22 14:22: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 // 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) { && amountWritten != fileSize) {
setStatus(Status.error); setStatus(Status.error);
this.error = Error.connection; this.error = Error.connection;
@ -313,11 +313,6 @@ public abstract class FileTransfer {
@SuppressWarnings("JavaLangClash") @SuppressWarnings("JavaLangClash")
public enum Error { public enum Error {
/**
* No error.
*/
none("No error"),
/** /**
* The peer did not find any of the provided stream mechanisms * The peer did not find any of the provided stream mechanisms
* acceptable. * acceptable.