Skip to content

Commit 5c43e36

Browse files
committed
Make sure the contentType of detectCharset could be null.
1 parent d2aebc6 commit 5c43e36

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
package us.codecraft.webmagic.utils;
2+
3+
import static org.junit.jupiter.api.Assertions.assertNull;
4+
5+
import java.io.IOException;
6+
7+
import org.junit.jupiter.api.Test;
8+
9+
class CharsetUtilsTest {
10+
11+
@Test
12+
void testDetectCharset() throws IOException {
13+
assertNull(CharsetUtils.detectCharset(null, new byte[0]));
14+
}
15+
16+
}

0 commit comments

Comments
 (0)