fix: privileged webdav falls back to global storage

This commit is contained in:
OpenClaw Agent
2026-09-17 03:18:30 +08:00
parent 44a365822b
commit 5a624a5d60
+6 -1
View File
@@ -108,7 +108,12 @@ func (a *App) storageForTask(t *Task) (RemoteStorage, string, bool) {
}
var cfg WebDAVConfig
if a.db.Where("user_id = ? AND enabled = ?", user.ID, true).First(&cfg).Error != nil || cfg.URL == "" {
return nil, "", false
// Privileged users fall back to the global WebDAV until a custom
// WebDAV configuration is enabled and tested successfully.
if a.cfg.WebDAVURL == "" || a.storage == nil {
return nil, "", false
}
return a.storage, a.cfg.WebDAVPath, true
}
return NewWebDAVStorage(Config{WebDAVURL: cfg.URL, WebDAVUser: cfg.Username, WebDAVPass: cfg.Password}), cfg.RootPath, true
}