From 30ab3a1142815c2a090bf83ebbe1dd226ef2921e Mon Sep 17 00:00:00 2001
From: Guillaume Heurtier <guillaume.heurtier@maarch.org>
Date: Wed, 21 Oct 2020 10:14:34 +0200
Subject: [PATCH] FIX #15159 TIME 0:05 fix error indexation with java

---
 src/frontend/app/viewer/document-viewer.component.ts | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/frontend/app/viewer/document-viewer.component.ts b/src/frontend/app/viewer/document-viewer.component.ts
index e2a13fa69a9..a44e3dfb118 100755
--- a/src/frontend/app/viewer/document-viewer.component.ts
+++ b/src/frontend/app/viewer/document-viewer.component.ts
@@ -873,7 +873,7 @@ export class DocumentViewerComponent implements OnInit, OnDestroy {
                         this.editInProgress = false;
                         clearInterval(this.intervalLockFile);
                         await this.loadTmpFile(`${data.fileTrunk}.${extension}`);
-                        if (this.mode === 'mainDocument') {
+                        if (this.mode === 'mainDocument' && this.resId !== null) {
                             this.saveMainDocument();
                         }
                     }
-- 
GitLab