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 }