AForge.NET

  :: AForge.NET Framework :: Articles :: Forums ::

Unhandled exception in Math.dll

Forum to discuss AForge.NET Framework, its features, API, how-tos, etc.

Unhandled exception in Math.dll

Postby maui » Wed Aug 03, 2011 12:03 pm

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();
        }
    }
}
maui
 
Posts: 22
Joined: Thu Feb 17, 2011 3:28 pm

Re: Unhandled exception in Math.dll

Postby andrew.kirillov » Wed Aug 03, 2011 12:55 pm

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.
With best regards,
Andrew


Interested in supporting AForge.NET Framework?
User avatar
andrew.kirillov
Site Admin, AForge.NET Developer
 
Posts: 3439
Joined: Fri Jan 23, 2009 9:12 am
Location: UK

Re: Unhandled exception in Math.dll

Postby andrew.kirillov » Wed Aug 03, 2011 3:57 pm

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 ...
With best regards,
Andrew


Interested in supporting AForge.NET Framework?
User avatar
andrew.kirillov
Site Admin, AForge.NET Developer
 
Posts: 3439
Joined: Fri Jan 23, 2009 9:12 am
Location: UK

Re: Unhandled exception in Math.dll

Postby andrew.kirillov » Wed Aug 03, 2011 8:03 pm

New build is available.
With best regards,
Andrew


Interested in supporting AForge.NET Framework?
User avatar
andrew.kirillov
Site Admin, AForge.NET Developer
 
Posts: 3439
Joined: Fri Jan 23, 2009 9:12 am
Location: UK

Re: Unhandled exception in Math.dll

Postby maui » Thu Aug 04, 2011 9:06 am

Thanks for the quick bugfix!
maui
 
Posts: 22
Joined: Thu Feb 17, 2011 3:28 pm




Return to AForge.NET Framework