only log string decode warning when failed

This commit is contained in:
wangyilei 2021-03-06 22:00:54 +08:00
parent 5a66b2c42d
commit e0e6cfd03f

View File

@ -302,8 +302,8 @@ public class StringBlock {
try {
return (m_isUTF8 ? UTF8_DECODER : UTF16LE_DECODER).decode(wrappedBuffer).toString();
} catch (CharacterCodingException ex) {
LOGGER.warning("Failed to decode a string at offset " + offset + " of length " + length);
if (!m_isUTF8) {
LOGGER.warning("Failed to decode a string at offset " + offset + " of length " + length);
return null;
}
}