mirror of
https://github.com/internetarchive/heritrix3.git
synced 2026-09-22 21:55:54 +00:00
Fix for [HER-1495] ARCRecord throws null pointer when trying to generate a RecoverableIOException
* ARCRecord.java
guard against bull statusBytes in exception message
This commit is contained in:
@@ -517,8 +517,9 @@ public class ARCRecord extends ArchiveRecord implements ARCConstants {
|
||||
byte [] statusBytes = HttpParser.readRawLine(getIn());
|
||||
int eolCharCount = getEolCharsCount(statusBytes);
|
||||
if (eolCharCount <= 0) {
|
||||
throw new RecoverableIOException("Failed to read http status where one " +
|
||||
" was expected: " + new String(statusBytes));
|
||||
throw new RecoverableIOException(
|
||||
"Failed to read http status where one was expected: "
|
||||
+ ((statusBytes == null) ? "" : new String(statusBytes)));
|
||||
}
|
||||
String statusLine = EncodingUtil.getString(statusBytes, 0,
|
||||
statusBytes.length - eolCharCount, ARCConstants.DEFAULT_ENCODING);
|
||||
|
||||
Reference in New Issue
Block a user