Skip to content

Commit be9ac54

Browse files
committed
Don't try to find lines of text chunks if there are no text chunks
1 parent 6a80610 commit be9ac54

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

src/main/java/technology/tabula/TextChunk.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,8 +192,13 @@ public static boolean allSameChar(List<TextChunk> textChunks) {
192192
}
193193

194194
public static List<Line> groupByLines(List<TextChunk> textChunks) {
195-
float bbwidth = Rectangle.boundingBoxOf(textChunks).width;
196195
List<Line> lines = new ArrayList<Line>();
196+
197+
if (textChunks.size() == 0) {
198+
return lines;
199+
}
200+
201+
float bbwidth = Rectangle.boundingBoxOf(textChunks).width;
197202

198203
Line l = new Line();
199204
l.addTextChunk(textChunks.get(0));

0 commit comments

Comments
 (0)