fix: fix the error handling for empty name on space update

This commit is contained in:
Roman Perekhod committed 2026-01-20 20:24:44 +01:00
1 parent 1af56f25fc
commit 0b6bd5ee68
3 files changed
+7 -4

No files matched your search

@@ -0,0 +1,6 @@
Bugfix: Fix the error handling for empty name on space update
Fix the error handling for empty name on space update.
https://github.com/owncloud/ocis/pull/11933
https://github.com/owncloud/ocis/issues/11887
+1 -1
View File
@@ -574,7 +574,7 @@ func (g Graph) updateDrive(w http.ResponseWriter, r *http.Request, apiVersion AP
}
}
if drive.GetName() != "" {
if _, ok := drive.GetNameOk(); ok {
spacename := strings.TrimSpace(drive.GetName())
if err := validateSpaceName(spacename); err != nil {
logger.Info().Err(err).Msg("could not update drive: spacename invalid")
@@ -401,9 +401,6 @@ The expected failures in this file are from features in the owncloud/ocis repo.
- [apiGraphUser/getUser.feature:696](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiGraphUser/getUser.feature#L696)
- [apiGraphUser/getUser.feature:700](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiGraphUser/getUser.feature#L700)
#### [PATCH /v1.0/drives/{drive-id} accepts empty name](https://github.com/owncloud/ocis/issues/11887)
- [apiSpaces/changeSpaces.feature:603](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpaces/changeSpaces.feature#L603)
Note: always have an empty line at the end of this file.
The bash script that processes this file requires that the last line has a newline on the end.