aboutsummaryrefslogtreecommitdiffstats
path: root/c_lhosts.go
diff options
context:
space:
mode:
Diffstat (limited to 'c_lhosts.go')
-rw-r--r--c_lhosts.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/c_lhosts.go b/c_lhosts.go
index 9425231..52e2b46 100644
--- a/c_lhosts.go
+++ b/c_lhosts.go
@@ -124,6 +124,9 @@ func (lhost *HostList) del(id uint64) {
func (lhost *HostList) sel(id uint64) *HostNode {
curr := lhost.head
+ if curr == nil {
+ return nil
+ }
for curr.next != nil && curr.ID != id {
curr = curr.next
}