diff --git a/cg/cg2101.cpp b/cg/cg2101.cpp index be56884ee..091047621 100755 --- a/cg/cg2101.cpp +++ b/cg/cg2101.cpp @@ -160,12 +160,16 @@ bool TMovimentoPN::controlla_liquidazione(const TDate& data, bool reset) const int TMovimentoPN::registra(bool re, bool force) { - int err = re ? TRelation::rewrite(force) : TRelation::write(force); - if (err != NOERR) - return err; - const TRectype& m = lfile().curr(); const long numreg = m.get_long("NUMREG"); + + int err = re ? TRelation::rewrite(force) : TRelation::write(force); + + if (err != NOERR) + { + CHECKD(!m.empty(), "Record empty after error ", err); + return err; + } if (!re) _cg.renum_key("NUMREG", numreg); diff --git a/cg/cg3100.cpp b/cg/cg3100.cpp index a3f349be5..589fbc3b2 100755 --- a/cg/cg3100.cpp +++ b/cg/cg3100.cpp @@ -2039,6 +2039,7 @@ bool TListaMov_application::set_print(int m) _tipo_lista = movimenti_sezionale; break; default: + CHECK(0, "Bad _tipoc"); break; }