sorengranfeldt / mare

FIM/MIM MA Rules Extension Framework
MIT License
3 stars 5 forks source link

Error in multivalue concatenate after remove all values from a multivale attribute #16

Closed antoniopanella closed 4 years ago

antoniopanella commented 4 years ago

I set a rule with this XML `

  <Target Name="FLAGIsMember" ActionOnNullSource="SetDefault" DefaultValue="false" />
</FlowRule>`

If the multivalue not contains "member" i receive a nullReference Excpetion in the method

` public class MultiValueConcatenate : Transform { [XmlAttribute("Separator")] public string Separator { get; set; } public override object Convert(object value) { if (value == null) return value;

        string returnValue = null;
        List<object> values = FromValueCollection(value);
        foreach (object val in values)
        {
            Tracer.TraceInformation("source-value {0}", val.ToString());
            returnValue = returnValue + val.ToString() + this.Separator;
        }
        returnValue = returnValue.Substring(0, returnValue.LastIndexOf(this.Separator)); 
        return returnValue;
    }
}

` at returnValue = returnValue.Substring(0, returnValue.LastIndexOf(this.Separator));

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs.