Hello,
I have a code like this(as an example) :
public class class1:UserCont rol
{
private MyOwnCollection BasedClass pList1;
public MyOwnCollection BasedClass List1
{
get{ return pList1;}
set{pList1 = value;}
}
public class1()
{
pList1 = new MyOwnCollection BasedClass()
}
private void class1_load(obj ect sender, EventArgs e)
{
LoadMethod();
}
private void LoadMethod()
{
int count = List1.Count;
}
}
This is a user control on a form docked as fill.
In Most of the computers this works ok, but on some computers this
crashes on LoadMethod(). For somereason the List1 is null and there
comes ObjectNullRefer enceException:O bject reference not set to an
instance of an object.
Why is List1 null? It is initialized in the constructor...T he
MyOwnCollection BasedClass constructor doesn't have any code...so it
should happen fast.
Regards, Jyri
I have a code like this(as an example) :
public class class1:UserCont rol
{
private MyOwnCollection BasedClass pList1;
public MyOwnCollection BasedClass List1
{
get{ return pList1;}
set{pList1 = value;}
}
public class1()
{
pList1 = new MyOwnCollection BasedClass()
}
private void class1_load(obj ect sender, EventArgs e)
{
LoadMethod();
}
private void LoadMethod()
{
int count = List1.Count;
}
}
This is a user control on a form docked as fill.
In Most of the computers this works ok, but on some computers this
crashes on LoadMethod(). For somereason the List1 is null and there
comes ObjectNullRefer enceException:O bject reference not set to an
instance of an object.
Why is List1 null? It is initialized in the constructor...T he
MyOwnCollection BasedClass constructor doesn't have any code...so it
should happen fast.
Regards, Jyri
Comment