Exception prevention in hashCount

- I got a report that an exception can occur, and while I can't
reproduce it, this should avoid it
This commit is contained in:
Peter Šurda 2016-11-01 14:44:39 +01:00
parent c94492f17e
commit 020a78b776
Signed by: PeterSurda
GPG Key ID: 0C5F50C0B5F37D87

View File

@ -49,7 +49,7 @@ class objectHashHolder(threading.Thread):
self.collectionOfPeerLists[random.randrange(0, self.size)].append(peerDetails)
def hashCount(self):
return sum([len(x) for x in self.collectionOfHashLists])
return sum([len(x) for x in self.collectionOfHashLists if type(x) is list])
def close(self):
self.shutdown = True