Commit e57b273d authored by Han-Wen Nienhuys's avatar Han-Wen Nienhuys

Panic if adding a nil child to an inode.

parent ad50ef4d
...@@ -147,6 +147,9 @@ func (me *Inode) GetChild(name string) (child *Inode) { ...@@ -147,6 +147,9 @@ func (me *Inode) GetChild(name string) (child *Inode) {
} }
func (me *Inode) AddChild(name string, child *Inode) { func (me *Inode) AddChild(name string, child *Inode) {
if child == nil {
log.Panicf("adding nil child as %q", name)
}
me.treeLock.Lock() me.treeLock.Lock()
defer me.treeLock.Unlock() defer me.treeLock.Unlock()
me.addChild(name, child) me.addChild(name, child)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment