Fixing crash while deleting non-existing manifest entries. HT to zsfelfoldi

This commit is contained in:
Daniel A. Nagy 2016-03-01 16:03:47 +01:00
parent 034f5bf238
commit f8c5b3dcee

View file

@ -145,7 +145,10 @@ func (self *manifestTrie) deleteEntry(path string) {
b := byte(path[0]) b := byte(path[0])
entry := self.entries[b] entry := self.entries[b]
if (entry != nil) && (entry.Path == path) { if entry == nil {
return
}
if entry.Path == path {
self.entries[b] = nil self.entries[b] = nil
return return
} }