diff --git a/document-readers/pdf-reader/src/main/java/org/springframework/ai/reader/pdf/layout/CharacterFactory.java b/document-readers/pdf-reader/src/main/java/org/springframework/ai/reader/pdf/layout/CharacterFactory.java
index b3e491d13..6eae80a7e 100644
--- a/document-readers/pdf-reader/src/main/java/org/springframework/ai/reader/pdf/layout/CharacterFactory.java
+++ b/document-readers/pdf-reader/src/main/java/org/springframework/ai/reader/pdf/layout/CharacterFactory.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2023-2024 the original author or authors.
+ * Copyright 2023-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -94,7 +94,7 @@ class CharacterFactory {
private char getCharacterFromTextPosition(final TextPosition textPosition) {
String string = textPosition.getUnicode();
- char character = string.charAt(0);
+ char character = !string.isEmpty() ? string.charAt(0) : '\0';
return character;
}
diff --git a/pom.xml b/pom.xml
index 29a12653a..b403eb5ef 100644
--- a/pom.xml
+++ b/pom.xml
@@ -280,7 +280,7 @@
3.25.2
- 3.0.3
+ 3.0.4
0.1.6
2.20.11
24.09