diff --git a/models/workflow/workflow.go b/models/workflow/workflow.go index fe421c2..b993b4c 100644 --- a/models/workflow/workflow.go +++ b/models/workflow/workflow.go @@ -258,17 +258,16 @@ func (d *Workflow) extractResourcePlantUML(line string, resource resources.Resou resource.SetName(splitted[1]) splittedComments := strings.Split(line, "'") - if len(splittedComments) <= 1 { - return "", nil, errors.New("Can't deserialize Object, there's no commentary") - } - comment := strings.ReplaceAll(splittedComments[1], "'", "") // for now it's a json. - instance := d.getNewInstance(dataName, splitted[1], peerID) - if instance == nil { - return "", nil, errors.New("No instance found.") - } - resource.AddInstances(instance) + if len(splittedComments) > 1 { + comment := strings.ReplaceAll(splittedComments[1], "'", "") // for now it's a json. + instance := d.getNewInstance(dataName, splitted[1], peerID) + if instance == nil { + return "", nil, errors.New("No instance found.") + } + resource.AddInstances(instance) - json.Unmarshal([]byte(comment), instance) + json.Unmarshal([]byte(comment), instance) + } // deserializer les instances... une instance doit par défaut avoir certaines valeurs d'accès. graphID := uuid.New() graphItem := &graph.GraphItem{