http upload: do not crash on invalid slot responses

This commit is contained in:
Daniel Gultsch 2018-02-11 17:54:59 +01:00
parent e2ac1db225
commit 64928d0ff1
1 changed files with 7 additions and 5 deletions

View File

@ -145,11 +145,11 @@ public class HttpUploadConnection implements Transferable {
} }
} }
} }
}
if (!canceled) { if (!canceled) {
new Thread(this::upload).start(); new Thread(this::upload).start();
} }
return; return;
}
} catch (MalformedURLException e) { } catch (MalformedURLException e) {
//fall through //fall through
} }
@ -229,7 +229,9 @@ public class HttpUploadConnection implements Transferable {
if (connection != null) { if (connection != null) {
connection.disconnect(); connection.disconnect();
} }
if (wakeLock.isHeld()) {
wakeLock.release(); wakeLock.release();
} }
} }
} }
}