mirror of https://github.com/Xhofe/alist
fix: fs/list interface conversion from copy alias (close #4279)
parent
f8fb48fb32
commit
7e3b13ea2d
|
@ -12,8 +12,8 @@ import (
|
||||||
|
|
||||||
// List files
|
// List files
|
||||||
func list(ctx context.Context, path string, args *ListArgs) ([]model.Obj, error) {
|
func list(ctx context.Context, path string, args *ListArgs) ([]model.Obj, error) {
|
||||||
meta := ctx.Value("meta").(*model.Meta)
|
meta, _ := ctx.Value("meta").(*model.Meta)
|
||||||
user := ctx.Value("user").(*model.User)
|
user, _ := ctx.Value("user").(*model.User)
|
||||||
virtualFiles := op.GetStorageVirtualFilesByPath(path)
|
virtualFiles := op.GetStorageVirtualFilesByPath(path)
|
||||||
storage, actualPath, err := op.GetStorageAndActualPath(path)
|
storage, actualPath, err := op.GetStorageAndActualPath(path)
|
||||||
if err != nil && len(virtualFiles) == 0 {
|
if err != nil && len(virtualFiles) == 0 {
|
||||||
|
@ -45,7 +45,7 @@ func list(ctx context.Context, path string, args *ListArgs) ([]model.Obj, error)
|
||||||
|
|
||||||
func whetherHide(user *model.User, meta *model.Meta, path string) bool {
|
func whetherHide(user *model.User, meta *model.Meta, path string) bool {
|
||||||
// if is admin, don't hide
|
// if is admin, don't hide
|
||||||
if user.CanSeeHides() {
|
if user == nil || user.CanSeeHides() {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
// if meta is nil, don't hide
|
// if meta is nil, don't hide
|
||||||
|
|
Loading…
Reference in New Issue