I repeatedly got a System.ArgumentNullException: Value
cannot be null.
at NSpring.Logging.EventFormatters.PatternEventFormatter...
at
NSpring.Logging.Loggers.EmailTemplate.set_body(String
value)
here is the code as is in v 1.1:
public string Body {
get {
return body;
}
set {
if (value == null) {
throw new ArgumentNullException();
}
lock (monitor) {
bodyPattern = new PatternEventFormatter(body);
bodyPattern.DataFormatter = dataFormatter;
body = value;
}
}
}
The problem is that you are using the value of the body
variable to instantiate the PatternEventFormatter
before the body variable has been set! Just moving the
body=value; line beofer the PatternEventFormatter(body)
line solves this error:
public string Body {
get {
return body;
}
set {
if (value == null) {
throw new ArgumentNullException();
}
lock (monitor) {
body = value;
bodyPattern = new PatternEventFormatter(body);
bodyPattern.DataFormatter = dataFormatter;
}
}
}
-Andreas
Logged In: YES
user_id=1286466
See if the patch that submitted fixes this problem for you.
I changed bodyPattern = new PatternEventFormatter(body); to
bodyPattern = new PatternEventFormatter(value); and fixed a
problem I had.