diff --git a/cg/cgsaldac.cpp b/cg/cgsaldac.cpp index d702f1555..983b7c3a6 100755 --- a/cg/cgsaldac.cpp +++ b/cg/cgsaldac.cpp @@ -1713,8 +1713,12 @@ void TPartita::update_reg(long nreg, const TRectype& mov, TPartite_array& pa) } else { - const int numrig = rig.get_int(PART_NUMRIG); - CHECK(numrig > 0, "Bad NUMRIG"); + int numrig = rig.get_int(PART_NUMRIG); + if (numrig <= 0) + { + NFCHECK("Bad NUMRIG: %d", numrig); + rig.put(PART_NUMRIG, numrig = 1); + } const TImporto imptotdoc = pa.importo_speso(nreg, numrig, false, 0x9); rig.put(PART_IMPTOTDOC, imptotdoc.valore());