Issue 11030: fix HasFile to avoid false positives for no filename (#11060)
Этот коммит содержится в:
коммит произвёл
Harrison Healey
родитель
bf233dec77
Коммит
16c11d7bf9
@@ -184,6 +184,10 @@ func (fs *FileStore) SetFile(name string, data []byte) error {
|
||||
|
||||
// HasFile returns true if the given file was previously persisted.
|
||||
func (fs *FileStore) HasFile(name string) (bool, error) {
|
||||
if name == "" {
|
||||
return false, nil
|
||||
}
|
||||
|
||||
resolvedPath := filepath.Join(filepath.Dir(fs.path), name)
|
||||
|
||||
_, err := os.Stat(resolvedPath)
|
||||
|
||||
Ссылка в новой задаче
Block a user