mirror of
https://github.com/octoleo/plantuml.git
synced 2024-11-22 13:05:09 +00:00
Merge pull request #742 from a-krawciw/ditaa_error
Fix Exception in empty Ditaa Diagram
This commit is contained in:
commit
0bc682468f
@ -1507,16 +1507,16 @@ public class TextGrid {
|
||||
public boolean initialiseWithLines(ArrayList<StringBuffer> lines, ProcessingOptions options) throws UnsupportedEncodingException {
|
||||
|
||||
//remove blank rows at the bottom
|
||||
boolean done = false;
|
||||
int i;
|
||||
for(i = lines.size() - 1; !done; i--){
|
||||
StringBuffer row = lines.get(i);
|
||||
if(!StringUtils.isBlank(row.toString())) done = true;
|
||||
|
||||
rows = new ArrayList<>();
|
||||
|
||||
for (StringBuffer row:lines) {
|
||||
if(!StringUtils.isBlank(row.toString()))
|
||||
rows.add(row);
|
||||
}
|
||||
rows = new ArrayList<StringBuffer>(lines.subList(0, i + 2));
|
||||
|
||||
if(options != null) fixTabs(options.getTabSize());
|
||||
else fixTabs(options.DEFAULT_TAB_SIZE);
|
||||
else fixTabs(ProcessingOptions.DEFAULT_TAB_SIZE);
|
||||
|
||||
|
||||
// make all lines of equal length
|
||||
|
Loading…
Reference in New Issue
Block a user