fcatae / Arda

Arda is an open source tool designed to manage team workloads.
42 stars 18 forks source link

[Kanban] WorkloadRepository.EditWorkload fails if there is no file #45

Closed fcatae closed 7 years ago

fcatae commented 7 years ago

The problem is this code.

            var filesList = new List<File>();
            foreach (var f in workload.WBFilesList)
            {
                filesList.Add(new File()
                {
                    FileID = f.Item1,
                    FileLink = f.Item2,
                    FileName = f.Item3,
                    FileDescription = string.Empty,
                });
            }
fcatae commented 7 years ago

It also happens if Metrics, Technologies or Users are null.

fcatae commented 7 years ago

Easy fix: check if it is null.

if ( workload.WBTechnologies != null )