forked from mirror/monocles_chat_clean
Fix out of bounds exception for bad fallback spans
(cherry picked from commit 8f7dbd85688cc1f0df9477c39322784a1be322ff)
This commit is contained in:
parent
8644c74935
commit
293c21db2c
1 changed files with 3 additions and 1 deletions
|
@ -622,7 +622,9 @@ public class MessageParser extends AbstractParser implements Consumer<im.convers
|
|||
if (span.getAttribute("start") == null || span.getAttribute("end") == null) {
|
||||
bodyB.setLength(0);
|
||||
} else {
|
||||
bodyB.delete(bodyB.offsetByCodePoints(0, parseInt(span.getAttribute("start"))), bodyB.offsetByCodePoints(0, parseInt(span.getAttribute("end"))));
|
||||
try {
|
||||
bodyB.delete(bodyB.offsetByCodePoints(0, parseInt(span.getAttribute("start"))), bodyB.offsetByCodePoints(0, parseInt(span.getAttribute("end"))));
|
||||
} catch (final IndexOutOfBoundsException e) { /* bad span */ }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue