Problem loading Raids and Ts

09/05/2017 09:46 prani95#1
I have a problem when i try to load the instances like TS and Raids. This is the error:
Here the code where the load crashes:
Here the Database (is just test):
09/05/2017 10:19 IceTrailer#2
There is a NullReferenceException
Set breakpoints and try to find out which value is null.
If you did, add an if condition like

Code:
if (myVariable == null)
{
    continue; // or rather "return;"
}
09/05/2017 11:02 prani95#3
The problem is here:
Code:
public IEnumerable<ScriptedInstanceDTO> LoadByMap(short mapId)
        {
            using (var context = DataAccessHelper.CreateContext())
            {
                foreach (ScriptedInstance timespaceObject in context.ScriptedInstance.Where(c => c.MapId.Equals(mapId)))
                {
                    if (_mapper.Map<ScriptedInstanceDTO>(timespaceObject) != null)
                    {
                        yield return _mapper.Map<ScriptedInstanceDTO>(timespaceObject);
                    }
                }
            }
        }
But i can t find a solution :/
09/05/2017 11:18 IceTrailer#4
Since I have neither the source nor the time to do that for you,

set a breakpoint at the marked line and step over to find out whose value is null.

[Only registered and activated users can see links. Click Here To Register...]
09/05/2017 11:31 prani95#5
_mapper is null:
[Only registered and activated users can see links. Click Here To Register...]
Thanks for all your help, i will find a way to solve this (hope that) or i will wait someone who can help me
09/05/2017 11:51 IceTrailer#6
Okay that's what I thought.
Then use the following code
[Only registered and activated users can see links. Click Here To Register...]

And from now on you shouldn't get this error at this point anymore.

For any reason _mapper doesn't get intialized, maybe later I have time to have a look at the source.
Which files do you have? And did you change something?
09/05/2017 12:23 prani95#7
Thanks, i m using nosmagic files and adding a lot of things from the latest update in opennos.
09/05/2017 12:33 IceTrailer#8
Then you did something wrong.

You should search for a null initialization (_mapper = <return value which is null>) or have to search if it gets initialized at all.
09/05/2017 12:54 prani95#9
[Only registered and activated users can see links. Click Here To Register...]
Sorry i had forget to put here the mapper. Thanks for all of your time.