aboutsummaryrefslogtreecommitdiffstats
path: root/tree.go
diff options
context:
space:
mode:
Diffstat (limited to 'tree.go')
-rw-r--r--tree.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/tree.go b/tree.go
index 4a964a4..e57d315 100644
--- a/tree.go
+++ b/tree.go
@@ -151,6 +151,10 @@ func (t *Tree) walkEntries(base string, ch chan *File) {
// Decode transform an core.Object into a Tree struct
func (t *Tree) Decode(o core.Object) error {
+ if o.Type() != core.TreeObject {
+ return ErrUnsupportedObject
+ }
+
t.Hash = o.Hash()
if o.Size() == 0 {
return nil