[kernel] fix null pointer access FirstOrderNonLinearDS
@@ -90,6 +90,7 @@ FirstOrderNonLinearDS::FirstOrderNonLinearDS(const FirstOrderNonLinearDS & FONLD
_invM.reset(new SimpleMatrix(*(FONLDS.invM())));
// Memory stuff to me moved to graph/osi
+ if (FONLDS.fold())
_fold.reset(new SiconosVector(*(FONLDS.fold())));
_rMemory = FONLDS.rMemory();
}
@@ -161,8 +162,11 @@ void FirstOrderNonLinearDS::swapInMemory()
{
_xMemory.swap(*_x[0]);
_rMemory.swap(*_r);
+ if (_f) {
+ assert(_fold);
*_fold = *_f;
}
+}
// ===== COMPUTE PLUGINS FUNCTIONS =====
