Skip to content
This repository has been archived by the owner on Feb 28, 2019. It is now read-only.

Commit

Permalink
Fixing bad logic in create Namespace View
Browse files Browse the repository at this point in the history
  • Loading branch information
Dmitriy Gromov committed Oct 11, 2017
1 parent e5dc349 commit 56461f5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion r2/kv/store.go
Expand Up @@ -109,7 +109,8 @@ func (s *store) CreateNamespace(namespaceID string, uOpts r2.UpdateOptions) (*ru
return nil, r2.NewNotFoundError(fmt.Sprintf("namespace: %s does not exist", namespaceID))
}

view, err := ns.NamespaceView(0)
// Get the latest view of the namespace.
view, err := ns.NamespaceView(len(ns.Snapshots()) - 1)
if err != nil {
return nil, s.handleUpstreamError(err)
}
Expand Down

0 comments on commit 56461f5

Please sign in to comment.