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

Panic if setting nil inode.

parent 82f55060
...@@ -7,7 +7,6 @@ import ( ...@@ -7,7 +7,6 @@ import (
var _ = log.Println var _ = log.Println
type DefaultNodeFileSystem struct { type DefaultNodeFileSystem struct {
} }
func (me *DefaultNodeFileSystem) OnUnmount() { func (me *DefaultNodeFileSystem) OnUnmount() {
...@@ -40,6 +39,9 @@ func (me *DefaultFsNode) SetInode(node *Inode) { ...@@ -40,6 +39,9 @@ func (me *DefaultFsNode) SetInode(node *Inode) {
if me.inode != nil { if me.inode != nil {
panic("already have Inode") panic("already have Inode")
} }
if node == nil {
panic("SetInode called with nil Inode.")
}
me.inode = node me.inode = node
} }
......
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