mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-24 16:03:43 +08:00
fix get storage by access path
This commit is contained in:
@@ -623,7 +623,7 @@ func (self *SHost) GetStorageByFilePath(path string) *SStorage {
|
||||
return nil
|
||||
}
|
||||
for i := 0; i < len(hoststorages); i += 1 {
|
||||
if strings.HasPrefix(path, hoststorages[i].MountPoint) {
|
||||
if len(hoststorages[i].MountPoint) > 0 && strings.HasPrefix(path, hoststorages[i].MountPoint) {
|
||||
return hoststorages[i].GetStorage()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user