fix exception from network status

This commit is contained in:
Kashiko Koibumi 2024-05-15 12:41:50 +09:00
parent 4f0e34b4be
commit cdbe5f80e2
No known key found for this signature in database
GPG Key ID: 8F06E069E37C40C4
2 changed files with 4 additions and 4 deletions

View File

@ -195,9 +195,9 @@ class NetworkStatus(QtWidgets.QWidget, RetranslateMixin):
if not connectionpool.pool.inboundConnections: if not connectionpool.pool.inboundConnections:
self.window().setStatusIcon('yellow') self.window().setStatusIcon('yellow')
for i in range(self.tableWidgetConnectionCount.rowCount()): for i in range(self.tableWidgetConnectionCount.rowCount()):
if self.tableWidgetConnectionCount.item(i, 0).data(QtCore.Qt.ItemDataRole.UserRole).toPyObject() != destination: if self.tableWidgetConnectionCount.item(i, 0).data(QtCore.Qt.ItemDataRole.UserRole) != destination:
continue continue
if self.tableWidgetConnectionCount.item(i, 1).data(QtCore.Qt.ItemDataRole.UserRole).toPyObject() == outbound: if self.tableWidgetConnectionCount.item(i, 1).data(QtCore.Qt.ItemDataRole.UserRole) == outbound:
self.tableWidgetConnectionCount.removeRow(i) self.tableWidgetConnectionCount.removeRow(i)
break break

View File

@ -189,8 +189,8 @@ class Dandelion: # pylint: disable=old-style-class
try: try:
# random two connections # random two connections
self.stem = sample( self.stem = sample(
connectionpool.BMConnectionPool( sorted(connectionpool.BMConnectionPool(
).outboundConnections.values(), MAX_STEMS) ).outboundConnections.values()), MAX_STEMS)
# not enough stems available # not enough stems available
except ValueError: except ValueError:
self.stem = connectionpool.BMConnectionPool( self.stem = connectionpool.BMConnectionPool(