diff --git a/models/workspace/workspace_mongo_accessor.go b/models/workspace/workspace_mongo_accessor.go index b92571c..696c283 100644 --- a/models/workspace/workspace_mongo_accessor.go +++ b/models/workspace/workspace_mongo_accessor.go @@ -54,7 +54,9 @@ func (wfa *workspaceMongoAccessor) UpdateOne(set utils.DBObject, id string) (uti } } res, code, err := wfa.GenericUpdateOne(set, id, wfa, &Workspace{}) - wfa.share(res.(*Workspace), false, wfa.Caller) + if code == 200 && res != nil { + wfa.share(res.(*Workspace), false, wfa.Caller) + } return res, code, err }