From 9dc6c217fadeff36cf65de1e9e5c82512e19e82c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrian=20Z=C3=BCrcher?= Date: Tue, 17 Feb 2026 16:44:29 +0100 Subject: [PATCH] fix nil pointer error --- handlers/workspace.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/handlers/workspace.go b/handlers/workspace.go index 6cc1728..8f86446 100644 --- a/handlers/workspace.go +++ b/handlers/workspace.go @@ -153,8 +153,11 @@ func (aH *AccessHandler) DeleteWorkspace(c *gin.Context) { c.JSON(http.StatusInternalServerError, nil) return } + for _, u := range users { - if u.Settings.Workspace.Name == workspace.Name { + if u.Workspaces == nil { + continue + } else if u.Settings.Workspace.Name == workspace.Name { u.Settings.Workspace = nil } @@ -163,13 +166,14 @@ func (aH *AccessHandler) DeleteWorkspace(c *gin.Context) { }) } - // crearemove folder + // remove folder err = os.RemoveAll(workspace.Uuid.String()) if err != nil { aH.logger.Error("DeleteWorkspace", err) c.JSON(http.StatusBadRequest, models.NewJsonErrorResponse(err)) return } + } c.JSON(http.StatusOK, gin.H{