Add check for None.

This commit is contained in:
Yuxin Wang 2018-09-26 22:18:20 -04:00
parent 829ec58c47
commit b3ad70a229

View file

@ -75,7 +75,7 @@ class Peer(MessageServer):
def download(self, file, destination, progress):
with self._file_list_lock:
if file not in self._file_list.keys():
if self._file_list is None or file not in self._file_list.keys():
return False, 'Requested file {} does not exist, try list_file?'.format(file)
self._write_message(self._server_sock, {