Skip to content

Commit c1b17cf

Browse files
committed
update p2p table on user thread to fix null scene
1 parent 89007c4 commit c1b17cf

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

desktop/src/main/java/haveno/desktop/main/settings/network/NetworkSettingsView.java

+8-6
Original file line numberDiff line numberDiff line change
@@ -508,12 +508,14 @@ private boolean isPublicNodesDisabled() {
508508
}
509509

510510
private void updateP2PTable() {
511-
if (connectionService.isShutDownStarted()) return; // ignore if shutting down
512-
p2pPeersTableView.getItems().forEach(P2pNetworkListItem::cleanup);
513-
p2pNetworkListItems.clear();
514-
p2pNetworkListItems.setAll(p2PService.getNetworkNode().getAllConnections().stream()
515-
.map(connection -> new P2pNetworkListItem(connection, clockWatcher))
516-
.collect(Collectors.toList()));
511+
UserThread.execute(() -> {
512+
if (connectionService.isShutDownStarted()) return; // ignore if shutting down
513+
p2pPeersTableView.getItems().forEach(P2pNetworkListItem::cleanup);
514+
p2pNetworkListItems.clear();
515+
p2pNetworkListItems.setAll(p2PService.getNetworkNode().getAllConnections().stream()
516+
.map(connection -> new P2pNetworkListItem(connection, clockWatcher))
517+
.collect(Collectors.toList()));
518+
});
517519
}
518520

519521
private void updateMoneroConnectionsTable() {

0 commit comments

Comments
 (0)