From 51c81e19af8c35a9e9a909314f22478416a2ac0d Mon Sep 17 00:00:00 2001 From: lishuang Date: Fri, 19 Jun 2020 23:15:18 +0800 Subject: [PATCH] Fix the move to root dir feature. --- code/rest/matter_service.go | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/code/rest/matter_service.go b/code/rest/matter_service.go index eaae0ac..ba3fde7 100644 --- a/code/rest/matter_service.go +++ b/code/rest/matter_service.go @@ -962,11 +962,13 @@ func (this *MatterService) WrapParentDetail(request *http.Request, matter *Matte puuid := matter.Puuid tmpMatter := matter - for puuid != MATTER_ROOT { - pFile := this.matterDao.CheckByUuid(puuid) - tmpMatter.Parent = pFile - tmpMatter = pFile - puuid = pFile.Puuid + if matter.Uuid != MATTER_ROOT { + for puuid != MATTER_ROOT { + pFile := this.matterDao.CheckByUuid(puuid) + tmpMatter.Parent = pFile + tmpMatter = pFile + puuid = pFile.Puuid + } } return matter