Merge pull request #1753 from slingamn/rename

fix #1751
This commit is contained in:
Shivaram Lingamneni
2021-07-14 02:09:43 -04:00
committed by GitHub
+5 -3
View File
@@ -320,9 +320,11 @@ func (cm *ChannelManager) Rename(name string, newName string) (err error) {
defer func() {
if channel != nil && info.Founder != "" {
channel.Store(IncludeAllAttrs)
// we just flushed the channel under its new name, therefore this delete
// cannot be overwritten by a write to the old name:
cm.server.channelRegistry.Delete(info)
if oldCfname != newCfname {
// we just flushed the channel under its new name, therefore this delete
// cannot be overwritten by a write to the old name:
cm.server.channelRegistry.Delete(info)
}
}
}()