Page 1 of 1

Unhandled exception in Math.dll

PostPosted: Wed Aug 03, 2011 12:03 pm
by maui
Sorry for not using GoogleCode ...

Don't know if that's an error caused by me using the library incorrectly or if it is a bug (It worked with AForge 2.1.5.0).
I get an unhandled exception of type "System.NullReferenceException" in AForge.Math.dll at if(line == null):

Code: Select all
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using AForge.Math.Geometry;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            Line line = Line.FromSlopeIntercept(1.0F, 20.0F);

            if (line == null)
                throw new System.NullReferenceException();
        }
    }
}

Re: Unhandled exception in Math.dll

PostPosted: Wed Aug 03, 2011 12:55 pm
by andrew.kirillov
Hello,

Yes, seems to be a bug. The line class has overloaded == operator, which does not expect second parameter to be null. Will need to fix that.

Re: Unhandled exception in Math.dll

PostPosted: Wed Aug 03, 2011 3:57 pm
by andrew.kirillov
The fix is committed to trunk. So you can just rebuild AForge.Math.dll from sources if you feel comfortable about. Will try to put new build to downloads soon ...

Re: Unhandled exception in Math.dll

PostPosted: Wed Aug 03, 2011 8:03 pm
by andrew.kirillov
New build is available.

Re: Unhandled exception in Math.dll

PostPosted: Thu Aug 04, 2011 9:06 am
by maui
Thanks for the quick bugfix!