RED-8274 - Resize redaction in header leads to error state

This commit is contained in:
Corina Olariu 2024-01-18 10:11:48 +01:00
parent 9c41888721
commit 5a5b8625dd

View File

@ -100,7 +100,9 @@ public class ManualChangesApplicationService {
}
// need to reinsert the entity, due to the boundary having changed.
removeAndUpdateAndReInsertEntity(entityToBeResized, manualResizeRedaction, newStartOffset);
if (newStartOffset > -1) {
removeAndUpdateAndReInsertEntity(entityToBeResized, manualResizeRedaction, newStartOffset);
}
entityToBeResized.getManualOverwrite().addChange(manualResizeRedaction);
}
@ -140,9 +142,8 @@ public class ManualChangesApplicationService {
entityToBeResized.setPages(new HashSet<>());
entityToBeResized.getTextRange().setStart(newStartOffset);
entityToBeResized.getTextRange().setEnd(newStartOffset + manualResizeRedaction.getValue().length());
if (newStartOffset > -1) {
entityCreationService.addEntityToGraph(entityToBeResized, nodeToInsertInto);
}
entityCreationService.addEntityToGraph(entityToBeResized, nodeToInsertInto);
}