mirror of
https://github.com/status-im/go-waku.git
synced 2025-02-05 10:23:32 +00:00
fix: panic when removing pubsub topic (#759)
This commit is contained in:
parent
c132ee4303
commit
d317b294a0
@ -165,6 +165,11 @@ func (ps *WakuPeerstoreImpl) RemovePubSubTopic(p peer.ID, topic string) error {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if len(existingTopics) == 0 {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
for i := range existingTopics {
|
for i := range existingTopics {
|
||||||
existingTopics = append(existingTopics[:i], existingTopics[i+1:]...)
|
existingTopics = append(existingTopics[:i], existingTopics[i+1:]...)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user