Fix crash when no server connected to tracker yet
flavien's git/Projet_JAVA_P2P_STRI2A/pipeline/head This commit looks good Details

pull/101/head
Louis Royer 4 years ago
parent 4ba3055289
commit 9d4c98c466

@ -182,6 +182,9 @@ public abstract class ClientManagement extends ServeErrors implements Runnable {
* @throws VersionRemoteError
*/
protected String[] listDirectory() throws EmptyDirectory, InternalError, UnknownHostException, IOException, TransmissionError, ProtocolError, VersionError, SizeError, InternalRemoteError, ProtocolRemoteError, VersionRemoteError {
if (hostList.size() == 0) {
return new String[0];
}
ProtocolP2PPacket<?> d = createProtocolP2PPacket(new Payload(RequestResponseCode.LIST_REQUEST));
try {
d.sendRequest(getHostItemSocket(hostList.get(0)));

Loading…
Cancel
Save