Crash MKG when processing old closing invoices

When processing old closing invoices, it could occur in specific cases that the client crashed.