Menu

#55 NullReferenceException on entity ref or process instruction

0.8.2.0
open
Core (183)
2
2004-02-20
2003-05-23
Curt Arnold
No

When using an external entity to contain task
definitions, NAnt 0.8.2 will generate the following stack
trace:

INTERNAL ERROR
System.NullReferenceException: Object reference not
set to an instance of an obj
ect.
at
SourceForge.NAnt.LocationMap.GetXPathFromNode
(XmlNode node)
at SourceForge.NAnt.LocationMap.GetLocation
(XmlNode node)
at SourceForge.NAnt.TaskFactory.CreateTask
(XmlNode taskNode, Project proj)
at
SourceForge.NAnt.Project.InitializeProjectDocument
(XmlDocument doc)
at SourceForge.NAnt.Project.Execute()
at SourceForge.NAnt.Project.Run()

This is due to a flaw in
Project.InitializeProjectDocument which will pass an
EntityReference node to CreateTask which will
eventually fail to create an XPath reference.

Attached file contains a build file that will fail on 0.8.2
and a diff file that will fix the problem. The expected
result of the build file is to display "Hello, World".

Discussion

  • Curt Arnold

    Curt Arnold - 2003-05-23

    Diff file for Core/Project.cs with sample failing build file

     
  • Scott Hernandez

    Scott Hernandez - 2003-10-22
    • assigned_to: nobody --> skot
     
  • Gert Driesen

    Gert Driesen - 2003-11-27

    Logged In: YES
    user_id=707851

    Scott, made any progress on this ?

     
  • Scott Hernandez

    Scott Hernandez - 2004-02-20
    • priority: 5 --> 2
     
  • Scott Hernandez

    Scott Hernandez - 2004-02-20

    Logged In: YES
    user_id=4117

    As a first step I have removed the error generated by
    entities. The next step is to include the entity, and evaluate
    it correctly.

    For now, Entities are simply ignored.

     
  • Scott Hernandez

    Scott Hernandez - 2004-02-20

    Logged In: YES
    user_id=4117

    As a first step I have removed the error generated by
    entities. The next step is to include the entity, and evaluate
    it correctly.

    For now, Entities are simply ignored.

     
  • Curt Arnold

    Curt Arnold - 2004-02-21

    Logged In: YES
    user_id=27193

    The attachment had a fix and tests that fixed the whole problem. I don't
    know how much the underlying code changed, but I would think it would
    be simplier just to review the patch than to work through the problem
    piecemeal.

     
  • Gert Driesen

    Gert Driesen - 2004-07-12

    Logged In: YES
    user_id=707851

    Scott,

    Can you have another look at this ?

    Thanks !!

     

Log in to post a comment.