Menu

#5 Null reference exception

open
nobody
DAO Core (3)
5
2004-12-07
2004-12-07
Anonymous
No

A null refference exception is thrown because of the
following code in class MappingUnit, CreateMapping
method.

The faulty code segment is:

if (fi == null)
{
throw new MappingException("Invalid
mapping detected: No field " + fi.Name + " in
IPersistableObject " + persistableObject.GetType
().FullName);
}

If fi is null - you cannot use fi.Name ! - use
field.Name instead.

Discussion


Log in to post a comment.

MongoDB Logo MongoDB