trie icon indicating copy to clipboard operation
trie copied to clipboard

Fix invalid memory address or nil pointer dereference when deleting rune key

Open mohamedelhefni opened this issue 2 years ago • 0 comments

when trying to delete rune key for example

trie.Put("احمد", "محمد")
trie.Delete("محمد") // panic
panic: runtime error: invalid memory address or nil pointer dereference
e
[signal SIGSEGV: segmentation violation code=0x1 addr=0x10 pc=0x47e98e]

goroutine 1 [running]:
github.com/dghubble/trie.(*RuneTrie).Delete(0xc00000c030, {0x495405, 0x8})
        /home/hefni101/go/pkg/mod/github.com/dghubble/[email protected]
1002190126-ca25329b35c6/rune_trie.go:76 +0x1ae

mohamedelhefni avatar Mar 05 '22 19:03 mohamedelhefni