user: unconditonally stop network in updateNetwork()

This commit is contained in:
Simon Ser 2023-04-05 13:03:24 +02:00
parent ac16729f93
commit 41399ca6fd

View File

@ -1064,8 +1064,8 @@ func (u *user) updateNetwork(ctx context.Context, record *database.Network) (*ne
// If we're currently connected, disconnect and perform the necessary // If we're currently connected, disconnect and perform the necessary
// bookkeeping // bookkeeping
network.stop()
if network.conn != nil { if network.conn != nil {
network.stop()
// Note: this will set network.conn to nil // Note: this will set network.conn to nil
u.handleUpstreamDisconnected(network.conn) u.handleUpstreamDisconnected(network.conn)
} }