1
0
mirror of https://github.com/octoleo/plantuml.git synced 2024-10-03 01:09:04 +00:00

Merge pull request #742 from a-krawciw/ditaa_error

Fix Exception in empty Ditaa Diagram
This commit is contained in:
arnaudroques 2021-11-04 09:24:15 +01:00 committed by GitHub
commit 0bc682468f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1507,16 +1507,16 @@ public class TextGrid {
public boolean initialiseWithLines(ArrayList<StringBuffer> lines, ProcessingOptions options) throws UnsupportedEncodingException { public boolean initialiseWithLines(ArrayList<StringBuffer> lines, ProcessingOptions options) throws UnsupportedEncodingException {
//remove blank rows at the bottom //remove blank rows at the bottom
boolean done = false;
int i; rows = new ArrayList<>();
for(i = lines.size() - 1; !done; i--){
StringBuffer row = lines.get(i); for (StringBuffer row:lines) {
if(!StringUtils.isBlank(row.toString())) done = true; if(!StringUtils.isBlank(row.toString()))
rows.add(row);
} }
rows = new ArrayList<StringBuffer>(lines.subList(0, i + 2));
if(options != null) fixTabs(options.getTabSize()); if(options != null) fixTabs(options.getTabSize());
else fixTabs(options.DEFAULT_TAB_SIZE); else fixTabs(ProcessingOptions.DEFAULT_TAB_SIZE);
// make all lines of equal length // make all lines of equal length