updateLastSafe method
Update a last paragraph
into the document validating to make more safe the operation.
Implementation
void updateLastSafe(Paragraph paragraph) {
if (paragraphs.isEmpty) {
paragraphs.add(paragraph);
return;
}
paragraphs[paragraphs.length - 1] = paragraph;
}