diff --git a/models/workflow/workflow_mongo_accessor.go b/models/workflow/workflow_mongo_accessor.go index eaf6bd0..048fcce 100644 --- a/models/workflow/workflow_mongo_accessor.go +++ b/models/workflow/workflow_mongo_accessor.go @@ -92,7 +92,7 @@ func (a *workflowMongoAccessor) share(realData *Workflow, delete bool, caller *t func (a *workflowMongoAccessor) UpdateOne(set utils.DBObject, id string) (utils.DBObject, int, error) { // avoid the update if the schedule is the same set = a.verifyResource(set) - if set.(*Workflow).Graph.Partial { + if set.(*Workflow).Graph != nil && set.(*Workflow).Graph.Partial { return nil, 403, errors.New("you are not allowed to update a partial workflow") } res, code, err := utils.GenericUpdateOne(a.verifyResource(set), id, a, &Workflow{}) @@ -109,7 +109,7 @@ func (a *workflowMongoAccessor) UpdateOne(set utils.DBObject, id string) (utils. func (a *workflowMongoAccessor) StoreOne(data utils.DBObject) (utils.DBObject, int, error) { data = a.verifyResource(data) d := data.(*Workflow) - if d.Graph.Partial { + if d.Graph != nil && d.Graph.Partial { return nil, 403, errors.New("you are not allowed to update a partial workflow") } res, code, err := utils.GenericStoreOne(d, a)