CircuitBoard vBoard = this;
// Find the desired circuit shape
CircuitShape vShape = vBoard.GetComponent(vId);
In the above statement the vBoard is throwing null in certain time. Any idea?
Please help.
Thank you in advance….
more code.. this is a public function
class CircuitBoard :Canvas
{
public void Move(string iBoardId, string iCircuitShapeId, double iXCordinate, double iYCordinate)
{
CircuitBoard vBoard = this;
// secutity check..
if (null != vBoard)
{
string vId = PCBFactory.GetUniqueTag(iCircuitShapeId, vBoard);
// Find the desired circuit shape
CircuitShape vShape = vBoard.GetComponent(vId);
if (vShape != null)
{
// do something...
}
}
}
}
Why are you assigning
thisto something in the first place? Why not just try:There’s no need to define vBoard at all.