Skip to content

Commit a03f7d5

Browse files
authored
Bump org.apache.pdfbox to 3.0.4 and guard against empty unicode strings (#3271)
Fixes: #3265 * Bump org.apache.pdfbox to 3.0.4 * Guard against empty unicode strings Auto-cherry-pick to 1.0.x Signed-off-by: David Frizelle <david.frizelle@gmail.com> --------- Signed-off-by: David Frizelle <david.frizelle@gmail.com>
1 parent 48f577e commit a03f7d5

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

document-readers/pdf-reader/src/main/java/org/springframework/ai/reader/pdf/layout/CharacterFactory.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2023-2024 the original author or authors.
2+
* Copyright 2023-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -94,7 +94,7 @@ private double numberOfSpacesBetweenTwoCharacters(final TextPosition textPositio
9494

9595
private char getCharacterFromTextPosition(final TextPosition textPosition) {
9696
String string = textPosition.getUnicode();
97-
char character = string.charAt(0);
97+
char character = !string.isEmpty() ? string.charAt(0) : '\0';
9898
return character;
9999
}
100100

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@
280280
<protobuf-java.version>3.25.2</protobuf-java.version>
281281

282282
<!-- readers/writer/stores dependencies-->
283-
<pdfbox.version>3.0.3</pdfbox.version>
283+
<pdfbox.version>3.0.4</pdfbox.version>
284284
<pgvector.version>0.1.6</pgvector.version>
285285
<sap.hanadb.version>2.20.11</sap.hanadb.version>
286286
<coherence.version>24.09</coherence.version>

0 commit comments

Comments
 (0)