From 5a624a5d606e585414d81e4c8afb0f65377a8132 Mon Sep 17 00:00:00 2001 From: OpenClaw Agent Date: Thu, 17 Sep 2026 03:18:30 +0800 Subject: [PATCH] fix: privileged webdav falls back to global storage --- user_webdav.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/user_webdav.go b/user_webdav.go index b224768..575c846 100644 --- a/user_webdav.go +++ b/user_webdav.go @@ -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 }