Skip to content

Commit c44e320

Browse files
committed
Handle empty String argument in CharsetDetector.trimAttrValue
1 parent 62ff2fe commit c44e320

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

src/main/java/org/archive/format/text/charset/CharsetDetector.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,9 @@ protected String getCharsetFromMeta(byte buffer[],int len) throws IOException {
178178
}
179179

180180
private static String trimAttrValue(String value) {
181+
if (value.isEmpty()) {
182+
return value;
183+
}
181184
String result = value;
182185
if (result.charAt(0) == '"') {
183186
result = result.substring(1, result.length() - 1);

0 commit comments

Comments
 (0)