Hello, I get a NullReferenceException when running this:
void newSensor_AllFramesReady(object sender, AllFramesReadyEventArgs e)
{
Skeleton first = GetFirstSkeleton(e);
if (first == null)
{
return;
}
/**
* @TODO
* obsluzyc wyjatek null reference na wypadek gdy gubi szkielet
*/
long timestamp = e.OpenSkeletonFrame().Timestamp;
it is in the line of long timestamp
It occurse while 10-15 seconds if same action. For example I’m logging some data standing still. I log them in every frame. After few seconds I get the NullReferenceException.
What is the problem?
Ok so I fouund answer for my problem. It is very simple.
Whe my system/machine is overloaded or it slows down from any other reason frames ain`t analyzed as fast as they sould. That whey when this lag occurs I can’t open a frame. Thats why I get null.
Bellow solution of the problem
That way I’ll be safe from null and I’ll be able to use my timestamp as I need to 🙂