1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2024-11-26 14:02:06 +01:00

0 byte file causes file transfer to fail

git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/trunk@3471 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
Derek DeMoro 2006-02-16 20:10:20 +00:00 committed by derek
parent 665bf172f7
commit 3f9cf661ea

View file

@ -81,7 +81,16 @@ public class StreamInitiationProvider implements IQProvider {
if (elementName.equals("si")) {
done = true;
} else if (elementName.equals("file")) {
File file = new File(name, Long.parseLong(size));
long fileSize = 0;
if(size != null && size.trim().length() !=0){
try {
fileSize = Long.parseLong(size);
}
catch (NumberFormatException e) {
e.printStackTrace();
}
}
File file = new File(name, fileSize);
file.setHash(hash);
if (date != null)
file.setDate(DelayInformation.UTC_FORMAT.parse(date));